mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] power: reset: st-poweroff: Use of_device_get_match_data()
@ 2026-05-19  0:41 Rosen Penev
  2026-06-03 21:14 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-05-19  0:41 UTC (permalink / raw)
  To: linux-pm; +Cc: Sebastian Reichel, open list

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>
---
 drivers/power/reset/st-poweroff.c | 8 ++------
 1 file 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)) {
--
2.54.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: reset: st-poweroff: Use of_device_get_match_data()
  2026-05-19  0:41 [PATCH] power: reset: st-poweroff: Use of_device_get_match_data() Rosen Penev
@ 2026-06-03 21:14 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2026-06-03 21:14 UTC (permalink / raw)
  To: linux-pm, Rosen Penev; +Cc: Sebastian Reichel, linux-kernel


On Mon, 18 May 2026 17:41:44 -0700, Rosen Penev wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] power: reset: st-poweroff: Use of_device_get_match_data()
      commit: c05383b9074d72d244d3dea34832eeb725317575

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-03 21:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-19  0:41 [PATCH] power: reset: st-poweroff: Use of_device_get_match_data() Rosen Penev
2026-06-03 21:14 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®