Skip to content

Commit 73fedc3

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
parport: amiga: 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/parport/parport_amiga: section mismatch in reference: amiga_parallel_driver+0x8 (section: .data) -> amiga_parallel_remove (section: .exit.text) that triggers on an allmodconfig W=1 build. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent af07615 commit 73fedc3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/parport/parport_amiga.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,13 @@ static void __exit amiga_parallel_remove(struct platform_device *pdev)
229229
parport_put_port(port);
230230
}
231231

232-
static struct platform_driver amiga_parallel_driver = {
232+
/*
233+
* amiga_parallel_remove() lives in .exit.text. For drivers registered via
234+
* module_platform_driver_probe() this is ok because they cannot get unbound at
235+
* runtime. So mark the driver struct with __refdata to prevent modpost
236+
* triggering a section mismatch warning.
237+
*/
238+
static struct platform_driver amiga_parallel_driver __refdata = {
233239
.remove_new = __exit_p(amiga_parallel_remove),
234240
.driver = {
235241
.name = "amiga-parallel",

0 commit comments

Comments
 (0)