Skip to content

Commit 0537c8e

Browse files
Uwe Kleine-Königdtor
authored andcommitted
Input: amimouse - 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 module_platform_driver_probe(). Make this explicit to prevent the following section mismatch warning WARNING: modpost: drivers/input/mouse/amimouse: section mismatch in reference: amimouse_driver+0x8 (section: .data) -> amimouse_remove (section: .exit.text) that triggers on an allmodconfig W=1 build. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/2e3783106bf6bd9a7bdeb12b706378fb16316471.1711748999.git.u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent be81415 commit 0537c8e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/input/mouse/amimouse.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,13 @@ static void __exit amimouse_remove(struct platform_device *pdev)
132132
input_unregister_device(dev);
133133
}
134134

135-
static struct platform_driver amimouse_driver = {
135+
/*
136+
* amimouse_remove() lives in .exit.text. For drivers registered via
137+
* module_platform_driver_probe() this is ok because they cannot get unbound at
138+
* runtime. So mark the driver struct with __refdata to prevent modpost
139+
* triggering a section mismatch warning.
140+
*/
141+
static struct platform_driver amimouse_driver __refdata = {
136142
.remove_new = __exit_p(amimouse_remove),
137143
.driver = {
138144
.name = "amiga-mouse",

0 commit comments

Comments
 (0)