Skip to content

Commit d1dfcdd

Browse files
geertuDominik Brodowski
authored andcommitted
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>
1 parent 8f5ae30 commit d1dfcdd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/pcmcia/omap_cf.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,13 @@ static void __exit omap_cf_remove(struct platform_device *pdev)
302302
kfree(cf);
303303
}
304304

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 = {
306312
.driver = {
307313
.name = driver_name,
308314
},

0 commit comments

Comments
 (0)