2023-03-13 07:57:20

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 0/5] clocksource: Convert to platform remove callback returning void

Hello,

this patch series adapts the platform drivers below drivers/clk
to use the .remove_new() callback. Compared to the traditional .remove()
callback .remove_new() returns no value. This is a good thing because
the driver core doesn't (and cannot) cope for errors during remove. The
only effect of a non-zero return value in .remove() is that the driver
core emits a warning. The device is removed anyhow and an early return
from .remove() usually yields a resource leak.

Most clocksource drivers are not supposed to be removed. Two drivers are
adapted here to actually prevent removal. One driver is fixed not to
return an error code in .remove() and then the two remaining drivers
with a remove callback are trivially converted to .remove_new().

Best regards
Uwe

Uwe Kleine-König (5):
clocksource: sh_mtu2: Mark driver as non-removable
clocksource: timer-stm32-lp: Mark driver as non-removable
clocksource: timer-ti-dm: Improve error message in .remove
clocksource: timer-tegra186: Convert to platform remove callback
returning void
clocksource: timer-ti-dm: Convert to platform remove callback
returning void

drivers/clocksource/sh_mtu2.c | 7 +------
drivers/clocksource/timer-stm32-lp.c | 7 +------
drivers/clocksource/timer-tegra186.c | 6 ++----
drivers/clocksource/timer-ti-dm.c | 7 ++++---
4 files changed, 8 insertions(+), 19 deletions(-)


base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
--
2.39.1



2023-04-06 13:56:15

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH 0/5] clocksource: Convert to platform remove callback returning void

On 13/03/2023 08:54, Uwe Kleine-König wrote:
> Hello,
>
> this patch series adapts the platform drivers below drivers/clk
> to use the .remove_new() callback. Compared to the traditional .remove()
> callback .remove_new() returns no value. This is a good thing because
> the driver core doesn't (and cannot) cope for errors during remove. The
> only effect of a non-zero return value in .remove() is that the driver
> core emits a warning. The device is removed anyhow and an early return
> from .remove() usually yields a resource leak.
>
> Most clocksource drivers are not supposed to be removed. Two drivers are
> adapted here to actually prevent removal. One driver is fixed not to
> return an error code in .remove() and then the two remaining drivers
> with a remove callback are trivially converted to .remove_new().
>

Applied and fixed up patch #2


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

2023-04-06 14:11:57

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH 0/5] clocksource: Convert to platform remove callback returning void

Hello Daniel,

On Thu, Apr 06, 2023 at 03:54:11PM +0200, Daniel Lezcano wrote:
> On 13/03/2023 08:54, Uwe Kleine-K?nig wrote:
> > this patch series adapts the platform drivers below drivers/clk
> > to use the .remove_new() callback. Compared to the traditional .remove()
> > callback .remove_new() returns no value. This is a good thing because
> > the driver core doesn't (and cannot) cope for errors during remove. The
> > only effect of a non-zero return value in .remove() is that the driver
> > core emits a warning. The device is removed anyhow and an early return
> > from .remove() usually yields a resource leak.
> >
> > Most clocksource drivers are not supposed to be removed. Two drivers are
> > adapted here to actually prevent removal. One driver is fixed not to
> > return an error code in .remove() and then the two remaining drivers
> > with a remove callback are trivially converted to .remove_new().
> >
>
> Applied and fixed up patch #2

Great. Thank you.

Best regards
Uwe

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


Attachments:
(No filename) (1.15 kB)
signature.asc (499.00 B)
Download all attachments