* [PATCH 00/11] misc: Convert to platform remove callback returning void
@ 2024-02-21 9:53 Uwe Kleine-König
2024-02-21 9:53 ` [PATCH 02/11] cxl: " Uwe Kleine-König
2024-02-21 13:52 ` [PATCH 00/11] misc: " Arnd Bergmann
0 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2024-02-21 9:53 UTC (permalink / raw)
To: Arnd Bergmann, Greg Kroah-Hartman
Cc: Alexandre Belloni, Derek Kiernan, Andrew Donnellan,
Jiri Slaby (SUSE), linux-arm-msm, Nicolas Ferre, linux-kernel,
Claudiu Beznea, Michal Simek, Srinivas Kandagatla, Dragan Cvetic,
kernel, Justin Stitt, Frederic Barrat, John Stultz, Tomas Winkler,
Amol Maheshwari, linuxppc-dev, Appana Durga Kedareswara rao,
linux-arm-kernel, Kees Cook
Hello,
this series converts all drivers below drivers/misc 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 Greg or Arnd picks them up all
together.
Best regards
Uwe
Uwe Kleine-König (11):
misc: atmel-ssc: Convert to platform remove callback returning void
cxl: Convert to platform remove callback returning void
misc: fastrpc: Convert to platform remove callback returning void
misc: hisi_hikey_usb: Convert to platform remove callback returning
void
mei: vsc: Convert to platform remove callback returning void
misc: open-dice: Convert to platform remove callback returning void
misc: sram: Convert to platform remove callback returning void
misc: ti-st: st_kim: Convert to platform remove callback returning
void
misc: vcpu_stall_detector: Convert to platform remove callback
returning void
misc: xilinx_sdfec: Convert to platform remove callback returning void
misc: xilinx_tmr_inject: Convert to platform remove callback returning
void
drivers/misc/atmel-ssc.c | 6 ++----
drivers/misc/cxl/of.c | 5 ++---
drivers/misc/fastrpc.c | 6 ++----
drivers/misc/hisi_hikey_usb.c | 6 ++----
drivers/misc/mei/platform-vsc.c | 6 ++----
drivers/misc/open-dice.c | 5 ++---
drivers/misc/sram.c | 6 ++----
drivers/misc/ti-st/st_kim.c | 5 ++---
drivers/misc/vcpu_stall_detector.c | 6 ++----
drivers/misc/xilinx_sdfec.c | 5 ++---
drivers/misc/xilinx_tmr_inject.c | 5 ++---
11 files changed, 22 insertions(+), 39 deletions(-)
base-commit: 4893c639cc3659cefaa675bf1e59f4e7571afb5c
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 02/11] cxl: Convert to platform remove callback returning void
2024-02-21 9:53 [PATCH 00/11] misc: Convert to platform remove callback returning void Uwe Kleine-König
@ 2024-02-21 9:53 ` Uwe Kleine-König
2024-02-22 2:46 ` Andrew Donnellan
2024-02-21 13:52 ` [PATCH 00/11] misc: " Arnd Bergmann
1 sibling, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2024-02-21 9:53 UTC (permalink / raw)
To: Arnd Bergmann, Greg Kroah-Hartman
Cc: Frederic Barrat, linuxppc-dev, Andrew Donnellan, kernel,
linux-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/misc/cxl/of.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/cxl/of.c b/drivers/misc/cxl/of.c
index 25ce725035e7..bcc005dff1c0 100644
--- a/drivers/misc/cxl/of.c
+++ b/drivers/misc/cxl/of.c
@@ -431,7 +431,7 @@ int cxl_of_read_adapter_properties(struct cxl *adapter, struct device_node *np)
return 0;
}
-static int cxl_of_remove(struct platform_device *pdev)
+static void cxl_of_remove(struct platform_device *pdev)
{
struct cxl *adapter;
int afu;
@@ -441,7 +441,6 @@ static int cxl_of_remove(struct platform_device *pdev)
cxl_guest_remove_afu(adapter->afu[afu]);
cxl_guest_remove_adapter(adapter);
- return 0;
}
static void cxl_of_shutdown(struct platform_device *pdev)
@@ -501,6 +500,6 @@ struct platform_driver cxl_of_driver = {
.owner = THIS_MODULE
},
.probe = cxl_of_probe,
- .remove = cxl_of_remove,
+ .remove_new = cxl_of_remove,
.shutdown = cxl_of_shutdown,
};
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 02/11] cxl: Convert to platform remove callback returning void
2024-02-21 9:53 ` [PATCH 02/11] cxl: " Uwe Kleine-König
@ 2024-02-22 2:46 ` Andrew Donnellan
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Donnellan @ 2024-02-22 2:46 UTC (permalink / raw)
To: Uwe Kleine-König, Arnd Bergmann, Greg Kroah-Hartman
Cc: Frederic Barrat, linuxppc-dev, linux-kernel, kernel
On Wed, 2024-02-21 at 10:53 +0100, 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() 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>
Acked-by: Andrew Donnellan <ajd@linux.ibm.com>
> ---
> drivers/misc/cxl/of.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/misc/cxl/of.c b/drivers/misc/cxl/of.c
> index 25ce725035e7..bcc005dff1c0 100644
> --- a/drivers/misc/cxl/of.c
> +++ b/drivers/misc/cxl/of.c
> @@ -431,7 +431,7 @@ int cxl_of_read_adapter_properties(struct cxl
> *adapter, struct device_node *np)
> return 0;
> }
>
> -static int cxl_of_remove(struct platform_device *pdev)
> +static void cxl_of_remove(struct platform_device *pdev)
> {
> struct cxl *adapter;
> int afu;
> @@ -441,7 +441,6 @@ static int cxl_of_remove(struct platform_device
> *pdev)
> cxl_guest_remove_afu(adapter->afu[afu]);
>
> cxl_guest_remove_adapter(adapter);
> - return 0;
> }
>
> static void cxl_of_shutdown(struct platform_device *pdev)
> @@ -501,6 +500,6 @@ struct platform_driver cxl_of_driver = {
> .owner = THIS_MODULE
> },
> .probe = cxl_of_probe,
> - .remove = cxl_of_remove,
> + .remove_new = cxl_of_remove,
> .shutdown = cxl_of_shutdown,
> };
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 00/11] misc: Convert to platform remove callback returning void
2024-02-21 9:53 [PATCH 00/11] misc: Convert to platform remove callback returning void Uwe Kleine-König
2024-02-21 9:53 ` [PATCH 02/11] cxl: " Uwe Kleine-König
@ 2024-02-21 13:52 ` Arnd Bergmann
2024-03-04 22:36 ` Uwe Kleine-König
1 sibling, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2024-02-21 13:52 UTC (permalink / raw)
To: Uwe Kleine-König, Greg Kroah-Hartman
Cc: Alexandre Belloni, derek.kiernan@amd.com, Kees Cook,
linux-arm-msm, linuxppc-dev, linux-kernel, Claudiu Beznea,
John Stultz, Michal Simek, dragan.cvetic@amd.com,
Pengutronix Kernel Team, Justin Stitt, Frederic Barrat,
Srinivas Kandagatla, Tomas Winkler, Amol Maheshwari, Jiri Slaby,
Appana Durga Kedareswara rao, linux-arm-kernel, Andrew Donnellan
On Wed, Feb 21, 2024, at 10:53, Uwe Kleine-König wrote:
> Hello,
>
> this series converts all drivers below drivers/misc 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 Greg or Arnd picks them up all
> together.
These all look good to me, whole series
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 00/11] misc: Convert to platform remove callback returning void
2024-02-21 13:52 ` [PATCH 00/11] misc: " Arnd Bergmann
@ 2024-03-04 22:36 ` Uwe Kleine-König
2024-03-04 23:42 ` Greg Kroah-Hartman
0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2024-03-04 22:36 UTC (permalink / raw)
To: Arnd Bergmann, Greg Kroah-Hartman
Cc: Alexandre Belloni, derek.kiernan@amd.com, Jiri Slaby,
linux-arm-msm, Andrew Donnellan, linux-kernel, Claudiu Beznea,
Frederic Barrat, John Stultz, dragan.cvetic@amd.com,
Pengutronix Kernel Team, Justin Stitt, Michal Simek,
Srinivas Kandagatla, Tomas Winkler, Amol Maheshwari, linuxppc-dev,
Appana Durga Kedareswara rao, linux-arm-kernel, Kees Cook
[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]
Hello Arnd, hello Greg,
On Wed, Feb 21, 2024 at 02:52:29PM +0100, Arnd Bergmann wrote:
> On Wed, Feb 21, 2024, at 10:53, Uwe Kleine-König wrote:
> > Hello,
> >
> > this series converts all drivers below drivers/misc 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 Greg or Arnd picks them up all
> > together.
>
> These all look good to me, whole series
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
Thanks.
You (= Arnd and Greg) are the listed maintainers for drivers/misc/. How
is this series supposed to be merged? Would a pull request help?
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] 6+ messages in thread* Re: [PATCH 00/11] misc: Convert to platform remove callback returning void
2024-03-04 22:36 ` Uwe Kleine-König
@ 2024-03-04 23:42 ` Greg Kroah-Hartman
0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2024-03-04 23:42 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Alexandre Belloni, derek.kiernan@amd.com, Arnd Bergmann,
linux-arm-msm, Andrew Donnellan, linux-kernel, Claudiu Beznea,
Appana Durga Kedareswara rao, Frederic Barrat, John Stultz,
dragan.cvetic@amd.com, Pengutronix Kernel Team, Justin Stitt,
Michal Simek, Srinivas Kandagatla, Tomas Winkler, Amol Maheshwari,
linuxppc-dev, Jiri Slaby, linux-arm-kernel, Kees Cook
On Mon, Mar 04, 2024 at 11:36:23PM +0100, Uwe Kleine-König wrote:
> Hello Arnd, hello Greg,
>
> On Wed, Feb 21, 2024 at 02:52:29PM +0100, Arnd Bergmann wrote:
> > On Wed, Feb 21, 2024, at 10:53, Uwe Kleine-König wrote:
> > > Hello,
> > >
> > > this series converts all drivers below drivers/misc 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 Greg or Arnd picks them up all
> > > together.
> >
> > These all look good to me, whole series
> >
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> Thanks.
>
> You (= Arnd and Greg) are the listed maintainers for drivers/misc/. How
> is this series supposed to be merged? Would a pull request help?
I can take the patchset, let me catch up...
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-03-04 23:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-21 9:53 [PATCH 00/11] misc: Convert to platform remove callback returning void Uwe Kleine-König
2024-02-21 9:53 ` [PATCH 02/11] cxl: " Uwe Kleine-König
2024-02-22 2:46 ` Andrew Donnellan
2024-02-21 13:52 ` [PATCH 00/11] misc: " Arnd Bergmann
2024-03-04 22:36 ` Uwe Kleine-König
2024-03-04 23:42 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox