From: Felix Gu <ustc.gu@gmail.com>
To: Li-hao Kuo <lhjeff911@gmail.com>, Mark Brown <broonie@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Felix Gu <ustc.gu@gmail.com>
Subject: [PATCH] spi: sunplus-sp7021: use devm_reset_control_get_exclusive_deasserted()
Date: Sat, 14 Nov 2026 00:47:18 +0800 [thread overview]
Message-ID: <20261114-sunplus-reset-cleanup-v1-1-115e32fe8c1a@gmail.com> (raw)
Use devm_reset_control_get_exclusive_deasserted() to replace the
explicit reset acquisition, deassertion, and cleanup action registered
with devm_add_action_or_reset().
This simplifies reset handling and removes the custom reset assertion
callback while preserving reset assertion during cleanup.
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/spi/spi-sunplus-sp7021.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/drivers/spi/spi-sunplus-sp7021.c b/drivers/spi/spi-sunplus-sp7021.c
index 54431c363bbc..abb272dd7250 100644
--- a/drivers/spi/spi-sunplus-sp7021.c
+++ b/drivers/spi/spi-sunplus-sp7021.c
@@ -393,11 +393,6 @@ static int sp7021_spi_target_transfer_one(struct spi_controller *ctlr, struct sp
return ret;
}
-static void sp7021_spi_reset_control_assert(void *data)
-{
- reset_control_assert(data);
-}
-
static int sp7021_spi_controller_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -463,17 +458,10 @@ static int sp7021_spi_controller_probe(struct platform_device *pdev)
if (IS_ERR(pspim->spi_clk))
return dev_err_probe(dev, PTR_ERR(pspim->spi_clk), "clk get fail\n");
- pspim->rstc = devm_reset_control_get_exclusive(dev, NULL);
+ pspim->rstc = devm_reset_control_get_exclusive_deasserted(dev, NULL);
if (IS_ERR(pspim->rstc))
- return dev_err_probe(dev, PTR_ERR(pspim->rstc), "rst get fail\n");
-
- ret = reset_control_deassert(pspim->rstc);
- if (ret)
- return dev_err_probe(dev, ret, "failed to deassert reset\n");
-
- ret = devm_add_action_or_reset(dev, sp7021_spi_reset_control_assert, pspim->rstc);
- if (ret)
- return ret;
+ return dev_err_probe(dev, PTR_ERR(pspim->rstc),
+ "failed to get and deassert reset\n");
ret = devm_request_irq(dev, pspim->m_irq, sp7021_spi_host_irq,
IRQF_TRIGGER_RISING, pdev->name, pspim);
---
base-commit: 793807ca13bf3072fc6d16ce6d90e9ab9beff2a5
change-id: 20261114-sunplus-reset-cleanup-6f05470b018e
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
next reply other threads:[~2026-11-13 16:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 16:47 Felix Gu [this message]
2026-11-13 17:01 ` Philipp Zabel
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=20261114-sunplus-reset-cleanup-v1-1-115e32fe8c1a@gmail.com \
--to=ustc.gu@gmail.com \
--cc=broonie@kernel.org \
--cc=lhjeff911@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
/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®