bus: imx-weim: Use device_get_match_data()
authorRob Herring <robh@kernel.org>
Wed, 25 Oct 2023 16:12:21 +0000 (11:12 -0500)
committerShawn Guo <shawnguo@kernel.org>
Mon, 27 Nov 2023 03:05:30 +0000 (11:05 +0800)
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/bus/imx-weim.c

index 42c9386a7b423f4e95af06c673ef77dad7a097a8..6b5da73c85417644b5885e534c39917e4e5496a3 100644 (file)
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/mfd/syscon.h>
 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
 #include <linux/regmap.h>
@@ -202,9 +205,7 @@ static int weim_timing_setup(struct device *dev, struct device_node *np,
 
 static int weim_parse_dt(struct platform_device *pdev)
 {
-       const struct of_device_id *of_id = of_match_device(weim_id_table,
-                                                          &pdev->dev);
-       const struct imx_weim_devtype *devtype = of_id->data;
+       const struct imx_weim_devtype *devtype = device_get_match_data(&pdev->dev);
        int ret = 0, have_child = 0;
        struct device_node *child;
        struct weim_priv *priv;