Skip to content

Commit 5b44abb

Browse files
Uwe Kleine-Königjwrdegoede
authored andcommitted
platform/x86: hp-wmi:: Mark driver struct with __refdata to prevent section mismatch warning
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 a section mismatch warning: WARNING: modpost: drivers/platform/x86/hp/hp-wmi: section mismatch in reference: hp_wmi_driver+0x8 (section: .data) -> hp_wmi_bios_remove (section: .exit.text) Fixes: c165b80 ("hp-wmi: fix handling of platform device") Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent aa7dcba commit 5b44abb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/platform/x86/hp/hp-wmi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,13 @@ static const struct dev_pm_ops hp_wmi_pm_ops = {
15481548
.restore = hp_wmi_resume_handler,
15491549
};
15501550

1551-
static struct platform_driver hp_wmi_driver = {
1551+
/*
1552+
* hp_wmi_bios_remove() lives in .exit.text. For drivers registered via
1553+
* module_platform_driver_probe() this is ok because they cannot get unbound at
1554+
* runtime. So mark the driver struct with __refdata to prevent modpost
1555+
* triggering a section mismatch warning.
1556+
*/
1557+
static struct platform_driver hp_wmi_driver __refdata = {
15521558
.driver = {
15531559
.name = "hp-wmi",
15541560
.pm = &hp_wmi_pm_ops,

0 commit comments

Comments
 (0)