All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: cs42l43: Use devm_add_action_or_reset()
@ 2024-04-17  9:30 Charles Keepax
  2024-04-17 11:05 ` Andy Shevchenko
  2024-04-18  0:51 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Charles Keepax @ 2024-04-17  9:30 UTC (permalink / raw)
  To: broonie; +Cc: andy.shevchenko, linux-spi, patches

Use devm_add_action_or_reset() rather than manually cleaning up on the
error path.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 drivers/spi/spi-cs42l43.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-cs42l43.c b/drivers/spi/spi-cs42l43.c
index cffd9a177808..cdc61cd089ad 100644
--- a/drivers/spi/spi-cs42l43.c
+++ b/drivers/spi/spi-cs42l43.c
@@ -345,11 +345,9 @@ static int cs42l43_spi_probe(struct platform_device *pdev)
 
 	if (is_of_node(fwnode)) {
 		fwnode = fwnode_get_named_child_node(fwnode, "spi");
-		ret = devm_add_action(priv->dev, cs42l43_release_of_node, fwnode);
-		if (ret) {
-			fwnode_handle_put(fwnode);
+		ret = devm_add_action_or_reset(priv->dev, cs42l43_release_of_node, fwnode);
+		if (ret)
 			return ret;
-		}
 	}
 
 	if (has_sidecar) {
@@ -358,11 +356,9 @@ static int cs42l43_spi_probe(struct platform_device *pdev)
 			return dev_err_probe(priv->dev, ret,
 					     "Failed to register gpio swnode\n");
 
-		ret = devm_add_action(priv->dev, cs42l43_release_sw_node, NULL);
-		if (ret) {
-			software_node_unregister(&cs42l43_gpiochip_swnode);
+		ret = devm_add_action_or_reset(priv->dev, cs42l43_release_sw_node, NULL);
+		if (ret)
 			return ret;
-		}
 
 		ret = device_create_managed_software_node(&priv->ctlr->dev,
 							  cs42l43_cs_props, NULL);
-- 
2.39.2


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

* Re: [PATCH] spi: cs42l43: Use devm_add_action_or_reset()
  2024-04-17  9:30 [PATCH] spi: cs42l43: Use devm_add_action_or_reset() Charles Keepax
@ 2024-04-17 11:05 ` Andy Shevchenko
  2024-04-18  0:51 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2024-04-17 11:05 UTC (permalink / raw)
  To: Charles Keepax; +Cc: broonie, linux-spi, patches

On Wed, Apr 17, 2024 at 12:30 PM Charles Keepax
<ckeepax@opensource.cirrus.com> wrote:
>
> Use devm_add_action_or_reset() rather than manually cleaning up on the
> error path.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] spi: cs42l43: Use devm_add_action_or_reset()
  2024-04-17  9:30 [PATCH] spi: cs42l43: Use devm_add_action_or_reset() Charles Keepax
  2024-04-17 11:05 ` Andy Shevchenko
@ 2024-04-18  0:51 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2024-04-18  0:51 UTC (permalink / raw)
  To: Charles Keepax; +Cc: andy.shevchenko, linux-spi, patches

On Wed, 17 Apr 2024 10:30:26 +0100, Charles Keepax wrote:
> Use devm_add_action_or_reset() rather than manually cleaning up on the
> error path.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: cs42l43: Use devm_add_action_or_reset()
      commit: 719af321a84b9b6669a82a94708e7ca574971331

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2024-04-18  0:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17  9:30 [PATCH] spi: cs42l43: Use devm_add_action_or_reset() Charles Keepax
2024-04-17 11:05 ` Andy Shevchenko
2024-04-18  0:51 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.