]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commitdiff
pcmcia: omap_cf: Mark driver struct with __refdata to prevent section mismatch
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 13 Aug 2025 15:50:14 +0000 (17:50 +0200)
committerDominik Brodowski <linux@dominikbrodowski.net>
Sat, 16 Aug 2025 13:23:24 +0000 (15:23 +0200)
As described in the added code comment, a reference to .exit.text is ok
for drivers registered via platform_driver_probe().  Make this explicit
to prevent the following section mismatch warning

    WARNING: modpost: drivers/pcmcia/omap_cf: section mismatch in reference: omap_cf_driver+0x4 (section: .data) -> omap_cf_remove (section: .exit.text)

that triggers on an omap1_defconfig + CONFIG_OMAP_CF=m build.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
drivers/pcmcia/omap_cf.c

index 1b1dff56ec7b11f3e7acb6bc16f5d80bac46a94f..733777367c3b45058f0aefb9f5b76591130d8850 100644 (file)
@@ -302,7 +302,13 @@ static void __exit omap_cf_remove(struct platform_device *pdev)
        kfree(cf);
 }
 
-static struct platform_driver omap_cf_driver = {
+/*
+ * omap_cf_remove() lives in .exit.text. For drivers registered via
+ * platform_driver_probe() this is ok because they cannot get unbound at
+ * runtime. So mark the driver struct with __refdata to prevent modpost
+ * triggering a section mismatch warning.
+ */
+static struct platform_driver omap_cf_driver __refdata = {
        .driver = {
                .name   = driver_name,
        },