power: reset: vexpress: Use device_get_match_data()
authorRob Herring <robh@kernel.org>
Mon, 9 Oct 2023 17:29:14 +0000 (12:29 -0500)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 20 Oct 2023 22:57:55 +0000 (00:57 +0200)
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>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20231009172923.2457844-19-robh@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/reset/vexpress-poweroff.c

index 17064d7b19f61b1b778d34befbfd0d55ce571388..bb22b2db590787378ce998632ababc9f5ee4b0e1 100644 (file)
@@ -7,8 +7,8 @@
 #include <linux/delay.h>
 #include <linux/notifier.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/reboot.h>
 #include <linux/stat.h>
 #include <linux/vexpress.h>
@@ -108,20 +108,17 @@ static int _vexpress_register_restart_handler(struct device *dev)
 
 static int vexpress_reset_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match =
-                       of_match_device(vexpress_reset_of_match, &pdev->dev);
+       enum vexpress_reset_func func;
        struct regmap *regmap;
        int ret = 0;
 
-       if (!match)
-               return -EINVAL;
-
        regmap = devm_regmap_init_vexpress_config(&pdev->dev);
        if (IS_ERR(regmap))
                return PTR_ERR(regmap);
        dev_set_drvdata(&pdev->dev, regmap);
 
-       switch ((uintptr_t)match->data) {
+       func = (uintptr_t)device_get_match_data(&pdev->dev);
+       switch (func) {
        case FUNC_SHUTDOWN:
                vexpress_power_off_device = &pdev->dev;
                pm_power_off = vexpress_power_off;