Skip to content

Commit 141626d

Browse files
Uwe Kleine-Königalexandrebelloni
authored andcommitted
rtc: sh: 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 47712bc commit 141626d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/rtc/rtc-sh.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,13 @@ static const struct of_device_id sh_rtc_of_match[] = {
668668
};
669669
MODULE_DEVICE_TABLE(of, sh_rtc_of_match);
670670

671-
static struct platform_driver sh_rtc_platform_driver = {
671+
/*
672+
* sh_rtc_remove() lives in .exit.text. For drivers registered via
673+
* module_platform_driver_probe() this is ok because they cannot get unbound at
674+
* runtime. So mark the driver struct with __refdata to prevent modpost
675+
* triggering a section mismatch warning.
676+
*/
677+
static struct platform_driver sh_rtc_platform_driver __refdata = {
672678
.driver = {
673679
.name = DRV_NAME,
674680
.pm = &sh_rtc_pm_ops,

0 commit comments

Comments
 (0)