summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mxsfb
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-20 07:52:13 -0500
committerRob Herring <robh@kernel.org>2023-11-27 13:56:32 -0600
commite17049148678725248a57ecbf9c21df0fde3b434 (patch)
tree9274d138f06c7801fe356fe350bbed36ec08cf03 /drivers/gpu/drm/mxsfb
parent19b4c60ce8660a0e3a2cebd3e4dc0691928d015d (diff)
downloadlinux-e17049148678725248a57ecbf9c21df0fde3b434.tar.gz
linux-e17049148678725248a57ecbf9c21df0fde3b434.tar.bz2
linux-e17049148678725248a57ecbf9c21df0fde3b434.zip
drm: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data in a single step. With this, adjust the includes to explicitly include the correct headers. That also serves as preparation to remove implicit includes within the DT headers (of_device.h in particular). Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au> Link: https://lore.kernel.org/r/20231020125214.2930329-1-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/mxsfb')
-rw-r--r--drivers/gpu/drm/mxsfb/mxsfb_drv.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 625c1bfc4173..b483ef48216a 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -11,9 +11,10 @@
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/pm_runtime.h>
#include <drm/drm_atomic_helper.h>
@@ -346,18 +347,13 @@ MODULE_DEVICE_TABLE(of, mxsfb_dt_ids);
static int mxsfb_probe(struct platform_device *pdev)
{
struct drm_device *drm;
- const struct of_device_id *of_id =
- of_match_device(mxsfb_dt_ids, &pdev->dev);
int ret;
- if (!pdev->dev.of_node)
- return -ENODEV;
-
drm = drm_dev_alloc(&mxsfb_driver, &pdev->dev);
if (IS_ERR(drm))
return PTR_ERR(drm);
- ret = mxsfb_load(drm, of_id->data);
+ ret = mxsfb_load(drm, device_get_match_data(&pdev->dev));
if (ret)
goto err_free;