]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fbdev: imxfb: Use of_device_get_match_data()
authorRosen Penev <rosenp@gmail.com>
Mon, 18 May 2026 21:13:03 +0000 (14:13 -0700)
committerHelge Deller <deller@gmx.de>
Sun, 7 Jun 2026 16:25:42 +0000 (18:25 +0200)
Use of_device_get_match_data() to fetch the platform ID entry directly
instead of open-coding an of_match_device() lookup. No NULL check is
needed as every compatible string has a corresponding data section.

This also lets the driver drop the of_device.h include.

Assisted-by: Codex:GPT-5.5
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/imxfb.c

index a077bf346bdf4be2f123d3cc8ab237181fd92ea4..7a021da0a32a2d3ff09f1a1d3f2865a1599a6f65 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/lcd.h>
 #include <linux/math64.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/bitfield.h>
 
 #include <linux/regulator/consumer.h>
@@ -880,7 +879,6 @@ static int imxfb_probe(struct platform_device *pdev)
        struct lcd_device *lcd;
        struct fb_info *info;
        struct imx_fb_videomode *m;
-       const struct of_device_id *of_id;
        struct device_node *display_np;
        int ret, i;
        int bytes_per_pixel;
@@ -891,9 +889,7 @@ static int imxfb_probe(struct platform_device *pdev)
        if (ret < 0)
                return ret;
 
-       of_id = of_match_device(imxfb_of_dev_id, &pdev->dev);
-       if (of_id)
-               pdev->id_entry = of_id->data;
+       pdev->id_entry = of_device_get_match_data(&pdev->dev);
 
        info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev);
        if (!info)