mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi: sunplus-sp7021: use devm_reset_control_get_exclusive_deasserted()
@ 2026-11-13 16:47 Felix Gu
  2026-11-13 17:01 ` Philipp Zabel
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Gu @ 2026-11-13 16:47 UTC (permalink / raw)
  To: Li-hao Kuo, Mark Brown, Philipp Zabel; +Cc: linux-spi, linux-kernel, Felix Gu

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>


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

* Re: [PATCH] spi: sunplus-sp7021: use devm_reset_control_get_exclusive_deasserted()
  2026-11-13 16:47 [PATCH] spi: sunplus-sp7021: use devm_reset_control_get_exclusive_deasserted() Felix Gu
@ 2026-11-13 17:01 ` Philipp Zabel
  0 siblings, 0 replies; 2+ messages in thread
From: Philipp Zabel @ 2026-11-13 17:01 UTC (permalink / raw)
  To: Felix Gu, Li-hao Kuo, Mark Brown; +Cc: linux-spi, linux-kernel

On Sa, 2026-11-14 at 00:47 +0800, Felix Gu wrote:
> 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>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

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

end of thread, other threads:[~2026-11-13 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 16:47 [PATCH] spi: sunplus-sp7021: use devm_reset_control_get_exclusive_deasserted() Felix Gu
2026-11-13 17:01 ` Philipp Zabel

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®