fbdev: atmel_lcdfb: Stop using platform_driver_probe()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 7 Nov 2023 09:17:43 +0000 (10:17 +0100)
committerHelge Deller <deller@gmx.de>
Fri, 10 Nov 2023 06:34:18 +0000 (07:34 +0100)
commit13c8fb98b7bd3872e75f89c86a2453b0e4a99401
tree8954838142b1f65d569db65e5b757901966d8467
parentaba6ab57a910ad4b940c2024d15f2cdbf5b7f76b
fbdev: atmel_lcdfb: Stop using platform_driver_probe()

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/video/fbdev/atmel_lcdfb: section mismatch in reference: atmel_lcdfb_driver+0x4 (section: .data) -> atmel_lcdfb_remove (section: .exit.text)

[folded in patch by Nathan Chancellor]

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/atmel_lcdfb.c