From: Markus Elfring <Markus.Elfring@web.de>
To: linux-aspeed@lists.ozlabs.org, linux-hwmon@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Billy Tsai" <billy_tsai@aspeedtech.com>,
"Günter Röck" <linux@roeck-us.net>,
"Joel Stanley" <joel@jms.id.au>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Ryan Chen" <ryan_chen@aspeedtech.com>,
"Tan Siewert" <tan.siewert@9elements.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org, Felix Gu <ustc.gu@gmail.com>
Subject: [PATCH] hwmon: (aspeed-g6-pwm-tach) Use devm_reset_control_get_exclusive_deasserted() in aspeed_pwm_tach_probe()
Date: Sat, 14 Nov 2026 17:28:19 +0100 [thread overview]
Message-ID: <bbbc7228-cf98-437d-b240-ad29ee7fb4ac@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 14 Nov 2026 17:11:34 +0100
Use devm_reset_control_get_exclusive_deasserted() to replace the
explicit reset acquisition, deassertion, and cleanup action registered
with devm_add_action_or_reset().
Simplify reset handling and remove the custom reset assertion callback
while preserving reset assertion during cleanup.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/hwmon/aspeed-g6-pwm-tach.c | 20 ++------------------
1 file changed, 2 insertions(+), 18 deletions(-)
diff --git a/drivers/hwmon/aspeed-g6-pwm-tach.c b/drivers/hwmon/aspeed-g6-pwm-tach.c
index f07c9a036b69..a26a0d48dde7 100644
--- a/drivers/hwmon/aspeed-g6-pwm-tach.c
+++ b/drivers/hwmon/aspeed-g6-pwm-tach.c
@@ -448,13 +448,6 @@ static int aspeed_create_fan_monitor(struct device *dev,
return 0;
}
-static void aspeed_pwm_tach_reset_assert(void *data)
-{
- struct reset_control *rst = data;
-
- reset_control_assert(rst);
-}
-
static int aspeed_pwm_tach_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev, *hwmon;
@@ -475,19 +468,10 @@ static int aspeed_pwm_tach_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(priv->clk),
"Couldn't get clock\n");
priv->clk_rate = clk_get_rate(priv->clk);
- priv->reset = devm_reset_control_get_exclusive(dev, NULL);
+ priv->reset = devm_reset_control_get_exclusive_deasserted(dev, NULL);
if (IS_ERR(priv->reset))
return dev_err_probe(dev, PTR_ERR(priv->reset),
- "Couldn't get reset control\n");
-
- ret = reset_control_deassert(priv->reset);
- if (ret)
- return dev_err_probe(dev, ret,
- "Couldn't deassert reset control\n");
- ret = devm_add_action_or_reset(dev, aspeed_pwm_tach_reset_assert,
- priv->reset);
- if (ret)
- return ret;
+ "failed to get and deassert reset\n");
chip = devm_pwmchip_alloc(dev, PWM_ASPEED_NR_PWMS, 0);
if (IS_ERR(chip))
--
2.56.0
next reply other threads:[~2026-11-14 16:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 16:28 Markus Elfring [this message]
2026-11-14 16:32 ` [PATCH] hwmon: (aspeed-g6-pwm-tach) Use devm_reset_control_get_exclusive_deasserted() in aspeed_pwm_tach_probe() sashiko-bot
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=bbbc7228-cf98-437d-b240-ad29ee7fb4ac@web.de \
--to=markus.elfring@web.de \
--cc=andrew@codeconstruct.com.au \
--cc=billy_tsai@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=p.zabel@pengutronix.de \
--cc=ryan_chen@aspeedtech.com \
--cc=tan.siewert@9elements.com \
--cc=ustc.gu@gmail.com \
/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