Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pcmcia: omap_cf: Mark driver struct with __refdata to prevent section mismatch

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>

authored by

Geert Uytterhoeven and committed by
Dominik Brodowski
d1dfcdd3 8f5ae30d

+7 -1
+7 -1
drivers/pcmcia/omap_cf.c
··· 302 302 kfree(cf); 303 303 } 304 304 305 - static struct platform_driver omap_cf_driver = { 305 + /* 306 + * omap_cf_remove() lives in .exit.text. For drivers registered via 307 + * platform_driver_probe() this is ok because they cannot get unbound at 308 + * runtime. So mark the driver struct with __refdata to prevent modpost 309 + * triggering a section mismatch warning. 310 + */ 311 + static struct platform_driver omap_cf_driver __refdata = { 306 312 .driver = { 307 313 .name = driver_name, 308 314 },