]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 08:58:50 +0000 (10:58 +0200)
[ Upstream commit d1dfcdd30140c031ae091868fb5bed084132bca1 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pcmcia/omap_cf.c

index e22a752052f2f901a48bd949cc6b4d1c96549718..b8260dd12b1a80017e9ca11cc1599edb3dbe02f6 100644 (file)
@@ -305,7 +305,13 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
        return 0;
 }
 
-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,
        },