* [PATCH] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void
@ 2023-09-11 15:15 Uwe Kleine-König
2023-09-11 20:02 ` Stephen Boyd
2023-10-21 15:58 ` Bjorn Andersson
0 siblings, 2 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2023-09-11 15:15 UTC (permalink / raw)
To: Bjorn Andersson, Andy Gross, Konrad Dybcio
Cc: Michael Turquette, Stephen Boyd, linux-arm-msm, linux-clk, 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() is renamed to .remove().
qcom_msm8996_cbf_icc_remove() returned zero unconditionally. After
changing this function to return void instead, the driver can be
converted trivially to use .remove_new().
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/clk/qcom/clk-cbf-8996.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/clk/qcom/clk-cbf-8996.c b/drivers/clk/qcom/clk-cbf-8996.c
index 53f205a3f183..fe24b4abeab4 100644
--- a/drivers/clk/qcom/clk-cbf-8996.c
+++ b/drivers/clk/qcom/clk-cbf-8996.c
@@ -250,13 +250,11 @@ static int qcom_msm8996_cbf_icc_register(struct platform_device *pdev, struct cl
return 0;
}
-static int qcom_msm8996_cbf_icc_remove(struct platform_device *pdev)
+static void qcom_msm8996_cbf_icc_remove(struct platform_device *pdev)
{
struct icc_provider *provider = platform_get_drvdata(pdev);
icc_clk_unregister(provider);
-
- return 0;
}
#define qcom_msm8996_cbf_icc_sync_state icc_sync_state
#else
@@ -266,7 +264,7 @@ static int qcom_msm8996_cbf_icc_register(struct platform_device *pdev, struct c
return 0;
}
-#define qcom_msm8996_cbf_icc_remove(pdev) (0)
+#define qcom_msm8996_cbf_icc_remove(pdev) { }
#define qcom_msm8996_cbf_icc_sync_state NULL
#endif
@@ -340,9 +338,9 @@ static int qcom_msm8996_cbf_probe(struct platform_device *pdev)
return qcom_msm8996_cbf_icc_register(pdev, &cbf_mux.clkr.hw);
}
-static int qcom_msm8996_cbf_remove(struct platform_device *pdev)
+static void qcom_msm8996_cbf_remove(struct platform_device *pdev)
{
- return qcom_msm8996_cbf_icc_remove(pdev);
+ qcom_msm8996_cbf_icc_remove(pdev);
}
static const struct of_device_id qcom_msm8996_cbf_match_table[] = {
@@ -354,7 +352,7 @@ MODULE_DEVICE_TABLE(of, qcom_msm8996_cbf_match_table);
static struct platform_driver qcom_msm8996_cbf_driver = {
.probe = qcom_msm8996_cbf_probe,
- .remove = qcom_msm8996_cbf_remove,
+ .remove_new = qcom_msm8996_cbf_remove,
.driver = {
.name = "qcom-msm8996-cbf",
.of_match_table = qcom_msm8996_cbf_match_table,
base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
--
2.40.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void
2023-09-11 15:15 [PATCH] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-11 20:02 ` Stephen Boyd
2023-09-12 6:53 ` Uwe Kleine-König
2023-10-21 15:58 ` Bjorn Andersson
1 sibling, 1 reply; 7+ messages in thread
From: Stephen Boyd @ 2023-09-11 20:02 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Uwe Kleine-König
Cc: Michael Turquette, linux-arm-msm, linux-clk, kernel
Quoting Uwe Kleine-König (2023-09-11 08:15:48)
> 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() is renamed to .remove().
>
> qcom_msm8996_cbf_icc_remove() returned zero unconditionally. After
> changing this function to return void instead, the driver can be
> converted trivially to use .remove_new().
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Do you want to take this? Otherwise, I can apply it to fixes.
> drivers/clk/qcom/clk-cbf-8996.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/clk/qcom/clk-cbf-8996.c b/drivers/clk/qcom/clk-cbf-8996.c
> index 53f205a3f183..fe24b4abeab4 100644
> --- a/drivers/clk/qcom/clk-cbf-8996.c
> +++ b/drivers/clk/qcom/clk-cbf-8996.c
> @@ -250,13 +250,11 @@ static int qcom_msm8996_cbf_icc_register(struct platform_device *pdev, struct cl
> return 0;
> }
>
> -static int qcom_msm8996_cbf_icc_remove(struct platform_device *pdev)
> +static void qcom_msm8996_cbf_icc_remove(struct platform_device *pdev)
> {
> struct icc_provider *provider = platform_get_drvdata(pdev);
>
> icc_clk_unregister(provider);
> -
> - return 0;
> }
> #define qcom_msm8996_cbf_icc_sync_state icc_sync_state
> #else
> @@ -266,7 +264,7 @@ static int qcom_msm8996_cbf_icc_register(struct platform_device *pdev, struct c
>
> return 0;
> }
> -#define qcom_msm8996_cbf_icc_remove(pdev) (0)
> +#define qcom_msm8996_cbf_icc_remove(pdev) { }
It would be better if this was a static inline function.
> #define qcom_msm8996_cbf_icc_sync_state NULL
> #endif
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void
2023-09-11 20:02 ` Stephen Boyd
@ 2023-09-12 6:53 ` Uwe Kleine-König
2023-09-20 17:29 ` Bjorn Andersson
0 siblings, 1 reply; 7+ messages in thread
From: Uwe Kleine-König @ 2023-09-12 6:53 UTC (permalink / raw)
To: Stephen Boyd
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
Michael Turquette, linux-clk, kernel
[-- Attachment #1: Type: text/plain, Size: 1979 bytes --]
Hello Stephen,
On Mon, Sep 11, 2023 at 01:02:53PM -0700, Stephen Boyd wrote:
> Quoting Uwe Kleine-König (2023-09-11 08:15:48)
> > 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() is renamed to .remove().
> >
> > qcom_msm8996_cbf_icc_remove() returned zero unconditionally. After
> > changing this function to return void instead, the driver can be
> > converted trivially to use .remove_new().
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
>
> Do you want to take this? Otherwise, I can apply it to fixes.
if "you" == "Uwe Kleine-König": Please take it via your tree. There is
still much to do before the next synchronous step, so there is no urge.
If the patch goes in during the next merge window that's fine, too.
> > @@ -266,7 +264,7 @@ static int qcom_msm8996_cbf_icc_register(struct platform_device *pdev, struct c
> >
> > return 0;
> > }
> > -#define qcom_msm8996_cbf_icc_remove(pdev) (0)
> > +#define qcom_msm8996_cbf_icc_remove(pdev) { }
>
> It would be better if this was a static inline function.
Ack, but this applies to the state before my patch, too, and I think
this should be addressed separately. That's currently not in my focus,
so if someone else wants to address this, you're welcome.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void
2023-09-12 6:53 ` Uwe Kleine-König
@ 2023-09-20 17:29 ` Bjorn Andersson
2023-10-10 3:49 ` Stephen Boyd
0 siblings, 1 reply; 7+ messages in thread
From: Bjorn Andersson @ 2023-09-20 17:29 UTC (permalink / raw)
To: Stephen Boyd
Cc: Uwe Kleine-König, Andy Gross, Konrad Dybcio, linux-arm-msm,
Michael Turquette, linux-clk, kernel
On Tue, Sep 12, 2023 at 08:53:43AM +0200, Uwe Kleine-König wrote:
> Hello Stephen,
>
> On Mon, Sep 11, 2023 at 01:02:53PM -0700, Stephen Boyd wrote:
> > Quoting Uwe Kleine-König (2023-09-11 08:15:48)
> > > 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() is renamed to .remove().
> > >
> > > qcom_msm8996_cbf_icc_remove() returned zero unconditionally. After
> > > changing this function to return void instead, the driver can be
> > > converted trivially to use .remove_new().
> > >
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > ---
> >
> > Do you want to take this? Otherwise, I can apply it to fixes.
>
> if "you" == "Uwe Kleine-König": Please take it via your tree. There is
> still much to do before the next synchronous step, so there is no urge.
> If the patch goes in during the next merge window that's fine, too.
>
@Stephen, should I just pick this in the Qcom tree for 6.7 then?
Regards,
Bjorn
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void
2023-09-20 17:29 ` Bjorn Andersson
@ 2023-10-10 3:49 ` Stephen Boyd
2023-10-20 15:50 ` Uwe Kleine-König
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Boyd @ 2023-10-10 3:49 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Uwe Kleine-König, Andy Gross, Konrad Dybcio, linux-arm-msm,
Michael Turquette, linux-clk, kernel
Quoting Bjorn Andersson (2023-09-20 10:29:58)
> On Tue, Sep 12, 2023 at 08:53:43AM +0200, Uwe Kleine-König wrote:
> > Hello Stephen,
> >
> > On Mon, Sep 11, 2023 at 01:02:53PM -0700, Stephen Boyd wrote:
> > > Quoting Uwe Kleine-König (2023-09-11 08:15:48)
> > > > 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() is renamed to .remove().
> > > >
> > > > qcom_msm8996_cbf_icc_remove() returned zero unconditionally. After
> > > > changing this function to return void instead, the driver can be
> > > > converted trivially to use .remove_new().
> > > >
> > > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > ---
> > >
> > > Do you want to take this? Otherwise, I can apply it to fixes.
> >
> > if "you" == "Uwe Kleine-König": Please take it via your tree. There is
> > still much to do before the next synchronous step, so there is no urge.
> > If the patch goes in during the next merge window that's fine, too.
> >
>
> @Stephen, should I just pick this in the Qcom tree for 6.7 then?
>
Yes please.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void
2023-10-10 3:49 ` Stephen Boyd
@ 2023-10-20 15:50 ` Uwe Kleine-König
0 siblings, 0 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2023-10-20 15:50 UTC (permalink / raw)
To: Bjorn Andersson, Stephen Boyd
Cc: linux-arm-msm, Michael Turquette, Konrad Dybcio, Andy Gross,
kernel, linux-clk
[-- Attachment #1: Type: text/plain, Size: 1956 bytes --]
Hello,
On Mon, Oct 09, 2023 at 08:49:27PM -0700, Stephen Boyd wrote:
> Quoting Bjorn Andersson (2023-09-20 10:29:58)
> > On Tue, Sep 12, 2023 at 08:53:43AM +0200, Uwe Kleine-König wrote:
> > > On Mon, Sep 11, 2023 at 01:02:53PM -0700, Stephen Boyd wrote:
> > > > Quoting Uwe Kleine-König (2023-09-11 08:15:48)
> > > > > 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() is renamed to .remove().
> > > > >
> > > > > qcom_msm8996_cbf_icc_remove() returned zero unconditionally. After
> > > > > changing this function to return void instead, the driver can be
> > > > > converted trivially to use .remove_new().
> > > > >
> > > > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > > ---
> > > >
> > > > Do you want to take this? Otherwise, I can apply it to fixes.
> > >
> > > if "you" == "Uwe Kleine-König": Please take it via your tree. There is
> > > still much to do before the next synchronous step, so there is no urge.
> > > If the patch goes in during the next merge window that's fine, too.
> > >
> >
> > @Stephen, should I just pick this in the Qcom tree for 6.7 then?
>
> Yes please.
This patch isn't in next yet. Is it still scheduled to go in for
6.7-rc1?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void
2023-09-11 15:15 [PATCH] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-11 20:02 ` Stephen Boyd
@ 2023-10-21 15:58 ` Bjorn Andersson
1 sibling, 0 replies; 7+ messages in thread
From: Bjorn Andersson @ 2023-10-21 15:58 UTC (permalink / raw)
To: Andy Gross, Konrad Dybcio, Uwe Kleine-König
Cc: Michael Turquette, Stephen Boyd, linux-arm-msm, linux-clk, kernel
On Mon, 11 Sep 2023 17:15:48 +0200, Uwe Kleine-König wrote:
> 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() is renamed to .remove().
>
> [...]
Applied, thanks!
[1/1] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void
commit: abaf59c470a7c9c59bda8da3517ec2ff0513f5a6
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-10-21 15:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11 15:15 [PATCH] clk: qcom: cbf-msm8996: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-11 20:02 ` Stephen Boyd
2023-09-12 6:53 ` Uwe Kleine-König
2023-09-20 17:29 ` Bjorn Andersson
2023-10-10 3:49 ` Stephen Boyd
2023-10-20 15:50 ` Uwe Kleine-König
2023-10-21 15:58 ` Bjorn Andersson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox