[PATCH 1/5] watchdog: at91sam9: Stop using module_platform_driver_probe()

Nicolas Ferre nicolas.ferre at microchip.com
Tue Nov 7 01:19:47 PST 2023


On 06/11/2023 at 16:48, Uwe Kleine-König wrote:
> On today's platforms the benefit of platform_driver_probe() isn't that
> relevant any more. It allows to drop some code after booting (or module
> loading) for .probe() and discard the .remove() function completely if
> the driver is built-in. This typically saves a few 100k.
> 
> The downside of platform_driver_probe() is that the driver cannot be
> bound and unbound at runtime which is ancient and also slightly
> complicates testing. There are also thoughts to deprecate
> platform_driver_probe() because it adds some complexity in the driver
> core for little gain. Also many drivers don't use it correctly. This
> driver for example misses to mark the driver struct with __refdata which
> is needed to suppress a (W=1) modpost warning:
> 
>          WARNING: modpost: drivers/watchdog/at91sam9_wdt: section mismatch in reference: at91wdt_driver+0x4 (section: .data) -> at91wdt_remove (section: .exit.text)
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>

Acked-by: Nicolas Ferre <nicolas.ferre at microchip.com>

> ---
>   drivers/watchdog/at91sam9_wdt.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)

[..]




More information about the linux-arm-kernel mailing list