fbdev: amifb: Mark driver struct with __refdata to prevent section mismatch warning
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 9 Nov 2023 22:01:53 +0000 (23:01 +0100)
committerHelge Deller <deller@gmx.de>
Fri, 10 Nov 2023 08:16:02 +0000 (09:16 +0100)
As described in the added code comment, a reference to .exit.text is ok
for drivers registered via module_platform_driver_probe(). Make this
explicit to prevent a section mismatch warning.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/amifb.c

index b18c6b4f129a66cacc6041f05b52ef7bae2179ac..4a1bc693cebd44e63a86095000455a7f3836ad21 100644 (file)
@@ -3768,7 +3768,13 @@ static int __exit amifb_remove(struct platform_device *pdev)
        return 0;
 }
 
-static struct platform_driver amifb_driver = {
+/*
+ * amifb_remove() lives in .exit.text. For drivers registered via
+ * module_platform_driver_probe() this ok because they cannot get unboud at
+ * runtime. The driver needs to be marked with __refdata, otherwise modpost
+ * triggers a section mismatch warning.
+ */
+static struct platform_driver amifb_driver __refdata = {
        .remove = __exit_p(amifb_remove),
        .driver   = {
                .name   = "amiga-video",