linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] reset: Convert to platform remove callback returning void
@ 2024-03-05 21:32 Uwe Kleine-König
  2024-03-05 21:32 ` [PATCH 1/3] reset: meson-audio-arb: " Uwe Kleine-König
  2024-03-12  8:47 ` [PATCH 0/3] reset: " Philipp Zabel
  0 siblings, 2 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2024-03-05 21:32 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	linux-arm-kernel, linux-amlogic, linux-kernel, Nishanth Menon,
	Tero Kristo, Santosh Shilimkar, kernel

Hello,

this series converts all platform drivers below drivers/reset to struct
platform_driver::remove_new(). See commit 5c5a7680e67b ("platform:
Provide a remove callback that returns no value") for an extended
explanation and the eventual goal.

All conversations are trivial, because their .remove() callbacks
returned zero unconditionally.

There are no interdependencies between these patches, so they could be
picked up individually. But I'd hope that they get picked up all
together by Philipp.

Best regards
Uwe

Uwe Kleine-König (3):
  reset: meson-audio-arb: Convert to platform remove callback returning void
  reset: rzg2l-usbphy-ctrl: Convert to platform remove callback returning void
  reset: ti-sci: Convert to platform remove callback returning void

 drivers/reset/reset-meson-audio-arb.c   | 6 ++----
 drivers/reset/reset-rzg2l-usbphy-ctrl.c | 6 ++----
 drivers/reset/reset-ti-sci.c            | 6 ++----
 3 files changed, 6 insertions(+), 12 deletions(-)

base-commit: 11afac187274a6177a7ac82997f8691c0f469e41
-- 
2.43.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH 1/3] reset: meson-audio-arb: Convert to platform remove callback returning void
  2024-03-05 21:32 [PATCH 0/3] reset: Convert to platform remove callback returning void Uwe Kleine-König
@ 2024-03-05 21:32 ` Uwe Kleine-König
  2024-03-12  8:47 ` [PATCH 0/3] reset: " Philipp Zabel
  1 sibling, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2024-03-05 21:32 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	linux-arm-kernel, linux-amlogic, linux-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/reset/reset-meson-audio-arb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/reset/reset-meson-audio-arb.c b/drivers/reset/reset-meson-audio-arb.c
index 7891d52fa899..8740f5f6abf8 100644
--- a/drivers/reset/reset-meson-audio-arb.c
+++ b/drivers/reset/reset-meson-audio-arb.c
@@ -120,7 +120,7 @@ static const struct of_device_id meson_audio_arb_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, meson_audio_arb_of_match);
 
-static int meson_audio_arb_remove(struct platform_device *pdev)
+static void meson_audio_arb_remove(struct platform_device *pdev)
 {
 	struct meson_audio_arb_data *arb = platform_get_drvdata(pdev);
 
@@ -130,8 +130,6 @@ static int meson_audio_arb_remove(struct platform_device *pdev)
 	spin_unlock(&arb->lock);
 
 	clk_disable_unprepare(arb->clk);
-
-	return 0;
 }
 
 static int meson_audio_arb_probe(struct platform_device *pdev)
@@ -189,7 +187,7 @@ static int meson_audio_arb_probe(struct platform_device *pdev)
 
 static struct platform_driver meson_audio_arb_pdrv = {
 	.probe = meson_audio_arb_probe,
-	.remove = meson_audio_arb_remove,
+	.remove_new = meson_audio_arb_remove,
 	.driver = {
 		.name = "meson-audio-arb-reset",
 		.of_match_table = meson_audio_arb_of_match,
-- 
2.43.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 0/3] reset: Convert to platform remove callback returning void
  2024-03-05 21:32 [PATCH 0/3] reset: Convert to platform remove callback returning void Uwe Kleine-König
  2024-03-05 21:32 ` [PATCH 1/3] reset: meson-audio-arb: " Uwe Kleine-König
@ 2024-03-12  8:47 ` Philipp Zabel
  2024-05-25 10:14   ` Uwe Kleine-König
  1 sibling, 1 reply; 5+ messages in thread
From: Philipp Zabel @ 2024-03-12  8:47 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	linux-arm-kernel, linux-amlogic, linux-kernel, Nishanth Menon,
	Tero Kristo, Santosh Shilimkar, kernel

On Di, 2024-03-05 at 22:32 +0100, Uwe Kleine-König wrote:
> Hello,
> 
> this series converts all platform drivers below drivers/reset to struct
> platform_driver::remove_new(). See commit 5c5a7680e67b ("platform:
> Provide a remove callback that returns no value") for an extended
> explanation and the eventual goal.
> 
> All conversations are trivial, because their .remove() callbacks
> returned zero unconditionally.
> 
> There are no interdependencies between these patches, so they could be
> picked up individually. But I'd hope that they get picked up all
> together by Philipp.

Thank you, I'll pick them up.

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

regards
Philipp

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 0/3] reset: Convert to platform remove callback returning void
  2024-03-12  8:47 ` [PATCH 0/3] reset: " Philipp Zabel
@ 2024-05-25 10:14   ` Uwe Kleine-König
  2024-05-27  7:23     ` Philipp Zabel
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2024-05-25 10:14 UTC (permalink / raw)
  To: Philipp Zabel, Greg Kroah-Hartman
  Cc: Nishanth Menon, Neil Armstrong, Tero Kristo, Martin Blumenstingl,
	Kevin Hilman, linux-kernel, kernel, Santosh Shilimkar,
	linux-amlogic, linux-arm-kernel, Jerome Brunet


[-- Attachment #1.1: Type: text/plain, Size: 1348 bytes --]

Hello Philipp,

On Tue, Mar 12, 2024 at 09:47:24AM +0100, Philipp Zabel wrote:
> On Di, 2024-03-05 at 22:32 +0100, Uwe Kleine-König wrote:
> > this series converts all platform drivers below drivers/reset to struct
> > platform_driver::remove_new(). See commit 5c5a7680e67b ("platform:
> > Provide a remove callback that returns no value") for an extended
> > explanation and the eventual goal.
> > 
> > All conversations are trivial, because their .remove() callbacks
> > returned zero unconditionally.
> > 
> > There are no interdependencies between these patches, so they could be
> > picked up individually. But I'd hope that they get picked up all
> > together by Philipp.
> 
> Thank you, I'll pick them up.
> 
> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

These patches made it into next (as v6.9-rc1..6d89df61650d), but not yet
into Linus's tree for v6.10-rc1. I intend to send a PR to Greg early
next week changing platform_driver::remove to match remove_new to cook
long in next for v6.11-rc1. If these reset commits don't make it in in time,
I'll be so bold and just include the commits from your for-next branch
in my PR.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 0/3] reset: Convert to platform remove callback returning void
  2024-05-25 10:14   ` Uwe Kleine-König
@ 2024-05-27  7:23     ` Philipp Zabel
  0 siblings, 0 replies; 5+ messages in thread
From: Philipp Zabel @ 2024-05-27  7:23 UTC (permalink / raw)
  To: Uwe Kleine-König, Greg Kroah-Hartman
  Cc: Nishanth Menon, Neil Armstrong, Tero Kristo, Martin Blumenstingl,
	Kevin Hilman, linux-kernel, kernel, Santosh Shilimkar,
	linux-amlogic, linux-arm-kernel, Jerome Brunet

Hi Uwe,

On Sa, 2024-05-25 at 12:14 +0200, Uwe Kleine-König wrote:
> Hello Philipp,
> 
> On Tue, Mar 12, 2024 at 09:47:24AM +0100, Philipp Zabel wrote:
> > On Di, 2024-03-05 at 22:32 +0100, Uwe Kleine-König wrote:
> > > this series converts all platform drivers below drivers/reset to struct
> > > platform_driver::remove_new(). See commit 5c5a7680e67b ("platform:
> > > Provide a remove callback that returns no value") for an extended
> > > explanation and the eventual goal.
> > > 
> > > All conversations are trivial, because their .remove() callbacks
> > > returned zero unconditionally.
> > > 
> > > There are no interdependencies between these patches, so they could be
> > > picked up individually. But I'd hope that they get picked up all
> > > together by Philipp.
> > 
> > Thank you, I'll pick them up.
> > 
> > Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
> 
> These patches made it into next (as v6.9-rc1..6d89df61650d), but not yet
> into Linus's tree for v6.10-rc1. I intend to send a PR to Greg early next week changing
> platform_driver::remove to match remove_new to cook
> long in next for v6.11-rc1. If these reset commits don't make it in in time,
> I'll be so bold and just include the commits from your for-next branch
> in my PR.

Please do, thank you.

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

regards
Philipp

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2024-05-27  7:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-05 21:32 [PATCH 0/3] reset: Convert to platform remove callback returning void Uwe Kleine-König
2024-03-05 21:32 ` [PATCH 1/3] reset: meson-audio-arb: " Uwe Kleine-König
2024-03-12  8:47 ` [PATCH 0/3] reset: " Philipp Zabel
2024-05-25 10:14   ` Uwe Kleine-König
2024-05-27  7:23     ` Philipp Zabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).