From: Rosen Penev <rosenp@gmail.com>
To: linux-pm@vger.kernel.org
Cc: Sebastian Reichel <sre@kernel.org>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] power: reset: st-poweroff: Use of_device_get_match_data()
Date: Mon, 18 May 2026 17:41:44 -0700 [thread overview]
Message-ID: <20260519004144.626969-1-rosenp@gmail.com> (raw)
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
next reply other threads:[~2026-05-19 0:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 0:41 Rosen Penev [this message]
2026-06-03 21:14 ` Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260519004144.626969-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®