]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fbdev: atmel_lcdfb: Use of_device_get_match_data()
authorRosen Penev <rosenp@gmail.com>
Tue, 19 May 2026 00:36:13 +0000 (17:36 -0700)
committerHelge Deller <deller@gmx.de>
Sun, 7 Jun 2026 16:25:42 +0000 (18:25 +0200)
Use of_device_get_match_data() to retrieve the driver match data instead
of open-coding the OF match lookup and dereferencing match->data.

This also removes the deprecated of_device.h include from the driver.

No need for NULL check as every compatible has a corresponding data
component.

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/atmel_lcdfb.c

index 9dfbc531021073b1bfd9a975df31b60e69083806..87406a5a2dcf37f29d6fae583924b6a9db6c4132 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <video/of_videomode.h>
 #include <video/of_display_timing.h>
 #include <linux/regulator/consumer.h>
@@ -56,7 +55,7 @@ struct atmel_lcdfb_info {
 
        struct atmel_lcdfb_pdata pdata;
 
-       struct atmel_lcdfb_config *config;
+       const struct atmel_lcdfb_config *config;
        struct regulator        *reg_lcd;
 };
 
@@ -930,8 +929,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
        int ret;
        int i;
 
-       sinfo->config = (struct atmel_lcdfb_config*)
-               of_match_device(atmel_lcdfb_dt_ids, dev)->data;
+       sinfo->config = of_device_get_match_data(dev);
 
        display_np = of_parse_phandle(np, "display", 0);
        if (!display_np) {