Skip to content

Commit 755795c

Browse files
Uwe Kleine-Königtiwai
authored andcommitted
OSS: dmasound/paula: 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: sound/oss/dmasound/dmasound_paula: section mismatch in reference: amiga_audio_driver+0x8 (section: .data) -> amiga_audio_remove (section: .exit.text) that triggers on an allmodconfig W=1 build. Signed-off-by: Uwe Kleine-König <[email protected]> Message-ID: <c216a129aa88f3af5c56fe6612a472f7a882f048.1711748999.git.u.kleine-koenig@pengutronix.de> Signed-off-by: Takashi Iwai <[email protected]>
1 parent c33f0d4 commit 755795c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sound/oss/dmasound/dmasound_paula.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,13 @@ static void __exit amiga_audio_remove(struct platform_device *pdev)
725725
dmasound_deinit();
726726
}
727727

728-
static struct platform_driver amiga_audio_driver = {
728+
/*
729+
* amiga_audio_remove() lives in .exit.text. For drivers registered via
730+
* module_platform_driver_probe() this is ok because they cannot get unbound at
731+
* runtime. So mark the driver struct with __refdata to prevent modpost
732+
* triggering a section mismatch warning.
733+
*/
734+
static struct platform_driver amiga_audio_driver __refdata = {
729735
.remove_new = __exit_p(amiga_audio_remove),
730736
.driver = {
731737
.name = "amiga-audio",

0 commit comments

Comments
 (0)