diff options
author | Rob Herring <robh@kernel.org> | 2023-10-17 22:36:10 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-11-01 11:02:17 +0100 |
commit | 830fafce06e6fc2e63e141799833f7c7a73cf62b (patch) | |
tree | d9b5f379a230da54e8a8b70c1095c2e65d72acbb /drivers/mfd/twl4030-power.c | |
parent | mfd: mc13xxx-spi/wm831x-spi: Use spi_get_device_match_data() (diff) | |
download | linux-830fafce06e6fc2e63e141799833f7c7a73cf62b.tar.xz linux-830fafce06e6fc2e63e141799833f7c7a73cf62b.zip |
mfd: Use device_get_match_data() in a bunch of drivers
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.
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231017203612.2701060-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd/twl4030-power.c')
-rw-r--r-- | drivers/mfd/twl4030-power.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index e35b0f788c50..1595e9c76132 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -27,8 +27,8 @@ #include <linux/pm.h> #include <linux/mfd/twl.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/of.h> -#include <linux/of_device.h> #include <asm/mach-types.h> @@ -883,7 +883,6 @@ static int twl4030_power_probe(struct platform_device *pdev) { const struct twl4030_power_data *pdata = dev_get_platdata(&pdev->dev); struct device_node *node = pdev->dev.of_node; - const struct of_device_id *match; int err = 0; int err2 = 0; u8 val; @@ -904,10 +903,8 @@ static int twl4030_power_probe(struct platform_device *pdev) return err; } - match = of_match_device(of_match_ptr(twl4030_power_of_match), - &pdev->dev); - if (match && match->data) - pdata = match->data; + if (node) + pdata = device_get_match_data(&pdev->dev); if (pdata) { err = twl4030_power_configure_scripts(pdata); |