From: Rosen Penev <rosenp@gmail.com>
To: linux-fbdev@vger.kernel.org
Cc: Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Helge Deller <deller@gmx.de>, Frank Li <Frank.Li@nxp.com>,
Fabio Estevam <festevam@gmail.com>,
linux-arm-kernel@lists.infradead.org (moderated list:FREESCALE
IMX / MXC FRAMEBUFFER DRIVER),
dri-devel@lists.freedesktop.org (open list:FRAMEBUFFER LAYER),
imx@lists.linux.dev (open list:ARM/FREESCALE IMX / MXC ARM
ARCHITECTURE), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] fbdev: imxfb: Use of_device_get_match_data()
Date: Mon, 18 May 2026 14:13:03 -0700 [thread overview]
Message-ID: <20260518211303.10777-1-rosenp@gmail.com> (raw)
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>
---
drivers/video/fbdev/imxfb.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index a077bf346bdf..7a021da0a32a 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -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)
--
2.54.0
next reply other threads:[~2026-05-18 21:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 21:13 Rosen Penev [this message]
2026-05-19 7:52 ` [PATCH] fbdev: imxfb: Use of_device_get_match_data() Helge Deller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260518211303.10777-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=Frank.Li@nxp.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox