Skip to content

Commit 5dbde07

Browse files
Uwe Kleine-Königalexandrebelloni
authored andcommitted
rtc: at91rm9200: 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. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 2e2ad63 commit 5dbde07

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/rtc/rtc-at91rm9200.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,13 @@ static int at91_rtc_resume(struct device *dev)
635635

636636
static SIMPLE_DEV_PM_OPS(at91_rtc_pm_ops, at91_rtc_suspend, at91_rtc_resume);
637637

638-
static struct platform_driver at91_rtc_driver = {
638+
/*
639+
* at91_rtc_remove() lives in .exit.text. For drivers registered via
640+
* module_platform_driver_probe() this is ok because they cannot get unbound at
641+
* runtime. So mark the driver struct with __refdata to prevent modpost
642+
* triggering a section mismatch warning.
643+
*/
644+
static struct platform_driver at91_rtc_driver __refdata = {
639645
.remove = __exit_p(at91_rtc_remove),
640646
.shutdown = at91_rtc_shutdown,
641647
.driver = {

0 commit comments

Comments
 (0)