* [PATCH] soc: ti: smartreflex: Simplify getting the opam_sr pointer
@ 2022-10-12 14:00 Uwe Kleine-König
2022-12-19 21:41 ` Uwe Kleine-König
2023-04-12 14:25 ` Uwe Kleine-König
0 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2022-10-12 14:00 UTC (permalink / raw)
To: Nishanth Menon, Santosh Shilimkar; +Cc: linux-pm, linux-arm-kernel, kernel
The probe function stores the sr_info pointer using
platform_set_drvdata(). Use the corresponding platform_get_drvdata() to
retrieve that pointer in the remove and shutdown functions.
This simplifies these functions and makes error handling unnecessary.
This is a good thing as at least for .remove() returning an error code
doesn't have the desired effect.
This is a preparation for making platform remove callbacks return void.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/soc/ti/smartreflex.c | 30 ++----------------------------
1 file changed, 2 insertions(+), 28 deletions(-)
diff --git a/drivers/soc/ti/smartreflex.c b/drivers/soc/ti/smartreflex.c
index ad2bb72e640c..1d0b50feae44 100644
--- a/drivers/soc/ti/smartreflex.c
+++ b/drivers/soc/ti/smartreflex.c
@@ -940,21 +940,8 @@ static int omap_sr_probe(struct platform_device *pdev)
static int omap_sr_remove(struct platform_device *pdev)
{
- struct omap_sr_data *pdata = pdev->dev.platform_data;
struct device *dev = &pdev->dev;
- struct omap_sr *sr_info;
-
- if (!pdata) {
- dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
- return -EINVAL;
- }
-
- sr_info = _sr_lookup(pdata->voltdm);
- if (IS_ERR(sr_info)) {
- dev_warn(&pdev->dev, "%s: omap_sr struct not found\n",
- __func__);
- return PTR_ERR(sr_info);
- }
+ struct omap_sr *sr_info = platform_get_drvdata(pdev);
if (sr_info->autocomp_active)
sr_stop_vddautocomp(sr_info);
@@ -968,20 +955,7 @@ static int omap_sr_remove(struct platform_device *pdev)
static void omap_sr_shutdown(struct platform_device *pdev)
{
- struct omap_sr_data *pdata = pdev->dev.platform_data;
- struct omap_sr *sr_info;
-
- if (!pdata) {
- dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
- return;
- }
-
- sr_info = _sr_lookup(pdata->voltdm);
- if (IS_ERR(sr_info)) {
- dev_warn(&pdev->dev, "%s: omap_sr struct not found\n",
- __func__);
- return;
- }
+ struct omap_sr *sr_info = platform_get_drvdata(pdev);
if (sr_info->autocomp_active)
sr_stop_vddautocomp(sr_info);
base-commit: 4fe89d07dcc2804c8b562f6c7896a45643d34b2f
--
2.37.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] soc: ti: smartreflex: Simplify getting the opam_sr pointer
2022-10-12 14:00 [PATCH] soc: ti: smartreflex: Simplify getting the opam_sr pointer Uwe Kleine-König
@ 2022-12-19 21:41 ` Uwe Kleine-König
2023-04-12 14:25 ` Uwe Kleine-König
1 sibling, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2022-12-19 21:41 UTC (permalink / raw)
To: Nishanth Menon, Santosh Shilimkar; +Cc: kernel, linux-arm-kernel, linux-pm
[-- Attachment #1.1: Type: text/plain, Size: 920 bytes --]
Hello,
On Wed, Oct 12, 2022 at 04:00:32PM +0200, Uwe Kleine-König wrote:
> The probe function stores the sr_info pointer using
> platform_set_drvdata(). Use the corresponding platform_get_drvdata() to
> retrieve that pointer in the remove and shutdown functions.
>
> This simplifies these functions and makes error handling unnecessary.
> This is a good thing as at least for .remove() returning an error code
> doesn't have the desired effect.
>
> This is a preparation for making platform remove callbacks return void.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
I didn't get any feedback on this patch and it didn't appear in next.
Did if fell through the cracks? Are there any concerns?
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: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] soc: ti: smartreflex: Simplify getting the opam_sr pointer
2022-10-12 14:00 [PATCH] soc: ti: smartreflex: Simplify getting the opam_sr pointer Uwe Kleine-König
2022-12-19 21:41 ` Uwe Kleine-König
@ 2023-04-12 14:25 ` Uwe Kleine-König
2023-04-13 5:29 ` Tony Lindgren
2023-04-14 16:04 ` Arnd Bergmann
1 sibling, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2023-04-12 14:25 UTC (permalink / raw)
To: Nishanth Menon, Santosh Shilimkar
Cc: kernel, linux-arm-kernel, linux-pm, Tony Lindgren, Arnd Bergmann
[-- Attachment #1.1: Type: text/plain, Size: 2890 bytes --]
Hello,
[Cc += Tony Lindgren + Arnd Bergmann who did care about the last change
to this driver]
On Wed, Oct 12, 2022 at 04:00:32PM +0200, Uwe Kleine-König wrote:
> The probe function stores the sr_info pointer using
> platform_set_drvdata(). Use the corresponding platform_get_drvdata() to
> retrieve that pointer in the remove and shutdown functions.
>
> This simplifies these functions and makes error handling unnecessary.
> This is a good thing as at least for .remove() returning an error code
> doesn't have the desired effect.
>
> This is a preparation for making platform remove callbacks return void.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This patch still applies to v6.3-rc1, but I didn't get any feedback
since 6 months now. I need this change to eventually make
platform_driver's remove callback return void.
Best regards
Uwe
[Keeping a full quote below for Tony and Arnd]
> ---
> drivers/soc/ti/smartreflex.c | 30 ++----------------------------
> 1 file changed, 2 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/soc/ti/smartreflex.c b/drivers/soc/ti/smartreflex.c
> index ad2bb72e640c..1d0b50feae44 100644
> --- a/drivers/soc/ti/smartreflex.c
> +++ b/drivers/soc/ti/smartreflex.c
> @@ -940,21 +940,8 @@ static int omap_sr_probe(struct platform_device *pdev)
>
> static int omap_sr_remove(struct platform_device *pdev)
> {
> - struct omap_sr_data *pdata = pdev->dev.platform_data;
> struct device *dev = &pdev->dev;
> - struct omap_sr *sr_info;
> -
> - if (!pdata) {
> - dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
> - return -EINVAL;
> - }
> -
> - sr_info = _sr_lookup(pdata->voltdm);
> - if (IS_ERR(sr_info)) {
> - dev_warn(&pdev->dev, "%s: omap_sr struct not found\n",
> - __func__);
> - return PTR_ERR(sr_info);
> - }
> + struct omap_sr *sr_info = platform_get_drvdata(pdev);
>
> if (sr_info->autocomp_active)
> sr_stop_vddautocomp(sr_info);
> @@ -968,20 +955,7 @@ static int omap_sr_remove(struct platform_device *pdev)
>
> static void omap_sr_shutdown(struct platform_device *pdev)
> {
> - struct omap_sr_data *pdata = pdev->dev.platform_data;
> - struct omap_sr *sr_info;
> -
> - if (!pdata) {
> - dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
> - return;
> - }
> -
> - sr_info = _sr_lookup(pdata->voltdm);
> - if (IS_ERR(sr_info)) {
> - dev_warn(&pdev->dev, "%s: omap_sr struct not found\n",
> - __func__);
> - return;
> - }
> + struct omap_sr *sr_info = platform_get_drvdata(pdev);
>
> if (sr_info->autocomp_active)
> sr_stop_vddautocomp(sr_info);
>
> base-commit: 4fe89d07dcc2804c8b562f6c7896a45643d34b2f
--
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: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] soc: ti: smartreflex: Simplify getting the opam_sr pointer
2023-04-12 14:25 ` Uwe Kleine-König
@ 2023-04-13 5:29 ` Tony Lindgren
2023-04-14 16:04 ` Arnd Bergmann
1 sibling, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2023-04-13 5:29 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Nishanth Menon, Santosh Shilimkar, kernel, linux-arm-kernel,
linux-pm, Arnd Bergmann
* Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [230412 14:26]:
> Hello,
>
> [Cc += Tony Lindgren + Arnd Bergmann who did care about the last change
> to this driver]
>
> On Wed, Oct 12, 2022 at 04:00:32PM +0200, Uwe Kleine-König wrote:
> > The probe function stores the sr_info pointer using
> > platform_set_drvdata(). Use the corresponding platform_get_drvdata() to
> > retrieve that pointer in the remove and shutdown functions.
> >
> > This simplifies these functions and makes error handling unnecessary.
> > This is a good thing as at least for .remove() returning an error code
> > doesn't have the desired effect.
> >
> > This is a preparation for making platform remove callbacks return void.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> This patch still applies to v6.3-rc1, but I didn't get any feedback
> since 6 months now. I need this change to eventually make
> platform_driver's remove callback return void.
>
> Best regards
> Uwe
>
> [Keeping a full quote below for Tony and Arnd]
Looks good to me, maybe Arnd is still picking patches for the upcoming
merge window:
Reviewed-by: Tony Lindgren <tony@atomide.com>
> > ---
> > drivers/soc/ti/smartreflex.c | 30 ++----------------------------
> > 1 file changed, 2 insertions(+), 28 deletions(-)
> >
> > diff --git a/drivers/soc/ti/smartreflex.c b/drivers/soc/ti/smartreflex.c
> > index ad2bb72e640c..1d0b50feae44 100644
> > --- a/drivers/soc/ti/smartreflex.c
> > +++ b/drivers/soc/ti/smartreflex.c
> > @@ -940,21 +940,8 @@ static int omap_sr_probe(struct platform_device *pdev)
> >
> > static int omap_sr_remove(struct platform_device *pdev)
> > {
> > - struct omap_sr_data *pdata = pdev->dev.platform_data;
> > struct device *dev = &pdev->dev;
> > - struct omap_sr *sr_info;
> > -
> > - if (!pdata) {
> > - dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
> > - return -EINVAL;
> > - }
> > -
> > - sr_info = _sr_lookup(pdata->voltdm);
> > - if (IS_ERR(sr_info)) {
> > - dev_warn(&pdev->dev, "%s: omap_sr struct not found\n",
> > - __func__);
> > - return PTR_ERR(sr_info);
> > - }
> > + struct omap_sr *sr_info = platform_get_drvdata(pdev);
> >
> > if (sr_info->autocomp_active)
> > sr_stop_vddautocomp(sr_info);
> > @@ -968,20 +955,7 @@ static int omap_sr_remove(struct platform_device *pdev)
> >
> > static void omap_sr_shutdown(struct platform_device *pdev)
> > {
> > - struct omap_sr_data *pdata = pdev->dev.platform_data;
> > - struct omap_sr *sr_info;
> > -
> > - if (!pdata) {
> > - dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
> > - return;
> > - }
> > -
> > - sr_info = _sr_lookup(pdata->voltdm);
> > - if (IS_ERR(sr_info)) {
> > - dev_warn(&pdev->dev, "%s: omap_sr struct not found\n",
> > - __func__);
> > - return;
> > - }
> > + struct omap_sr *sr_info = platform_get_drvdata(pdev);
> >
> > if (sr_info->autocomp_active)
> > sr_stop_vddautocomp(sr_info);
> >
> > base-commit: 4fe89d07dcc2804c8b562f6c7896a45643d34b2f
>
> --
> Pengutronix e.K. | Uwe Kleine-König |
> Industrial Linux Solutions | https://www.pengutronix.de/ |
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] soc: ti: smartreflex: Simplify getting the opam_sr pointer
2023-04-12 14:25 ` Uwe Kleine-König
2023-04-13 5:29 ` Tony Lindgren
@ 2023-04-14 16:04 ` Arnd Bergmann
2023-04-14 18:33 ` Nishanth Menon
1 sibling, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2023-04-14 16:04 UTC (permalink / raw)
To: Uwe Kleine-König, Nishanth Menon, Santosh Shilimkar
Cc: Pengutronix Kernel Team, linux-arm-kernel, linux-pm,
Tony Lindgren
On Wed, Apr 12, 2023, at 16:25, Uwe Kleine-König wrote:
> Hello,
>
> [Cc += Tony Lindgren + Arnd Bergmann who did care about the last change
> to this driver]
>
> On Wed, Oct 12, 2022 at 04:00:32PM +0200, Uwe Kleine-König wrote:
>> The probe function stores the sr_info pointer using
>> platform_set_drvdata(). Use the corresponding platform_get_drvdata() to
>> retrieve that pointer in the remove and shutdown functions.
>>
>> This simplifies these functions and makes error handling unnecessary.
>> This is a good thing as at least for .remove() returning an error code
>> doesn't have the desired effect.
>>
>> This is a preparation for making platform remove callbacks return void.
>>
>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> This patch still applies to v6.3-rc1, but I didn't get any feedback
> since 6 months now. I need this change to eventually make
> platform_driver's remove callback return void.
Applied to the soc/drivers branch for 6.4 now.
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] soc: ti: smartreflex: Simplify getting the opam_sr pointer
2023-04-14 16:04 ` Arnd Bergmann
@ 2023-04-14 18:33 ` Nishanth Menon
0 siblings, 0 replies; 6+ messages in thread
From: Nishanth Menon @ 2023-04-14 18:33 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Uwe Kleine-König, Santosh Shilimkar, Pengutronix Kernel Team,
linux-arm-kernel, linux-pm, Tony Lindgren
On 18:04-20230414, Arnd Bergmann wrote:
> On Wed, Apr 12, 2023, at 16:25, Uwe Kleine-König wrote:
> > Hello,
> >
> > [Cc += Tony Lindgren + Arnd Bergmann who did care about the last change
> > to this driver]
> >
> > On Wed, Oct 12, 2022 at 04:00:32PM +0200, Uwe Kleine-König wrote:
> >> The probe function stores the sr_info pointer using
> >> platform_set_drvdata(). Use the corresponding platform_get_drvdata() to
> >> retrieve that pointer in the remove and shutdown functions.
> >>
> >> This simplifies these functions and makes error handling unnecessary.
> >> This is a good thing as at least for .remove() returning an error code
> >> doesn't have the desired effect.
> >>
> >> This is a preparation for making platform remove callbacks return void.
> >>
> >> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >
> > This patch still applies to v6.3-rc1, but I didn't get any feedback
> > since 6 months now. I need this change to eventually make
> > platform_driver's remove callback return void.
>
> Applied to the soc/drivers branch for 6.4 now.
>
> Arnd
Thanks Arnd, Tony.
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-04-14 18:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-12 14:00 [PATCH] soc: ti: smartreflex: Simplify getting the opam_sr pointer Uwe Kleine-König
2022-12-19 21:41 ` Uwe Kleine-König
2023-04-12 14:25 ` Uwe Kleine-König
2023-04-13 5:29 ` Tony Lindgren
2023-04-14 16:04 ` Arnd Bergmann
2023-04-14 18:33 ` Nishanth Menon
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).