Skip to content

Commit 47712bc

Browse files
Uwe Kleine-Königalexandrebelloni
authored andcommitted
rtc: pxa: 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 5621f28 commit 47712bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/rtc/rtc-pxa.c

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

404404
static SIMPLE_DEV_PM_OPS(pxa_rtc_pm_ops, pxa_rtc_suspend, pxa_rtc_resume);
405405

406-
static struct platform_driver pxa_rtc_driver = {
406+
/*
407+
* pxa_rtc_remove() lives in .exit.text. For drivers registered via
408+
* module_platform_driver_probe() this is ok because they cannot get unbound at
409+
* runtime. So mark the driver struct with __refdata to prevent modpost
410+
* triggering a section mismatch warning.
411+
*/
412+
static struct platform_driver pxa_rtc_driver __refdata = {
407413
.remove = __exit_p(pxa_rtc_remove),
408414
.driver = {
409415
.name = "pxa-rtc",

0 commit comments

Comments
 (0)