Skip to content

Commit ea6838b

Browse files
geertugregkh
authored andcommitted
pcmcia: omap_cf: Mark driver struct with __refdata to prevent section mismatch
[ Upstream commit d1dfcdd ] 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>
1 parent 1f97f6c commit ea6838b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/pcmcia/omap_cf.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,13 @@ static int __exit omap_cf_remove(struct platform_device *pdev)
305305
return 0;
306306
}
307307

308-
static struct platform_driver omap_cf_driver = {
308+
/*
309+
* omap_cf_remove() lives in .exit.text. For drivers registered via
310+
* platform_driver_probe() this is ok because they cannot get unbound at
311+
* runtime. So mark the driver struct with __refdata to prevent modpost
312+
* triggering a section mismatch warning.
313+
*/
314+
static struct platform_driver omap_cf_driver __refdata = {
309315
.driver = {
310316
.name = driver_name,
311317
},

0 commit comments

Comments
 (0)