diff options
| author | Rosen Penev <rosenp@gmail.com> | 2026-05-19 03:41:44 +0300 |
|---|---|---|
| committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-06-03 23:56:42 +0300 |
| commit | c05383b9074d72d244d3dea34832eeb725317575 (patch) | |
| tree | 686cf6cef7debc5c09b70e2416d2ad569e7fa785 | |
| parent | 5d543bf02965d1c04064acfd5e97d1529268d86f (diff) | |
| download | linux-c05383b9074d72d244d3dea34832eeb725317575.tar.xz | |
power: reset: st-poweroff: Use of_device_get_match_data()
Use of_device_get_match_data() to fetch the reset syscfg data directly
instead of open-coding an of_match_device() lookup.
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>
Link: https://patch.msgid.link/20260519004144.626969-1-rosenp@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| -rw-r--r-- | drivers/power/reset/st-poweroff.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/power/reset/st-poweroff.c b/drivers/power/reset/st-poweroff.c index 85175066beea..2c0cedd18406 100644 --- a/drivers/power/reset/st-poweroff.c +++ b/drivers/power/reset/st-poweroff.c @@ -9,7 +9,6 @@ #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/mfd/syscon.h> #include <linux/reboot.h> @@ -73,15 +72,12 @@ static const struct of_device_id st_reset_of_match[] = { static int st_reset_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - const struct of_device_id *match; struct device *dev = &pdev->dev; - match = of_match_device(st_reset_of_match, dev); - if (!match) + st_restart_syscfg = (struct reset_syscfg *)of_device_get_match_data(dev); + if (!st_restart_syscfg) return -ENODEV; - st_restart_syscfg = (struct reset_syscfg *)match->data; - st_restart_syscfg->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); if (IS_ERR(st_restart_syscfg->regmap)) { |
