Hi Uwe, On Tue, Nov 7, 2023 at 10:20 AM Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> 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. Which is a lot on platforms with only a few MiBs of RAM... > 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/amifb: section mismatch in reference: amifb_driver+0x4 (section: .data) -> amifb_remove (section: .exit.text) > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> Thanks for your patch! > --- a/drivers/video/fbdev/amifb.c > +++ b/drivers/video/fbdev/amifb.c > @@ -3530,7 +3530,7 @@ static inline void chipfree(void) > * Initialisation > */ > > -static int __init amifb_probe(struct platform_device *pdev) > +static int amifb_probe(struct platform_device *pdev) noreply@xxxxxxxxxxxxxx reported the following build failure for e.g. m68k-defconfig in next-20231108: WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x15c (section: .text) -> ami_modedb (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x17a (section: .text) -> amifb_hfmin (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x188 (section: .text) -> amifb_hfmax (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x190 (section: .text) -> amifb_vfmin (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x198 (section: .text) -> amifb_vfmax (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x1ba (section: .text) -> ami_modedb (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x1c4 (section: .text) -> ami_modedb (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x1ca (section: .text) -> mode_option (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x1ee (section: .text) -> ami_modedb (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x398 (section: .text) -> amifb_hfmin (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x39e (section: .text) -> amifb_hfmax (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x3a4 (section: .text) -> amifb_vfmin (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x3aa (section: .text) -> amifb_vfmax (section: .init.data) WARNING: modpost: vmlinux: section mismatch in reference: amifb_probe+0x3f0 (section: .text) -> mode_option (section: .init.data) ERROR: modpost: Section mismatches detected. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds