Skip to content

Commit 5621f28

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

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/rtc/rtc-mv.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,13 @@ static const struct of_device_id rtc_mv_of_match_table[] = {
303303
MODULE_DEVICE_TABLE(of, rtc_mv_of_match_table);
304304
#endif
305305

306-
static struct platform_driver mv_rtc_driver = {
306+
/*
307+
* mv_rtc_remove() lives in .exit.text. For drivers registered via
308+
* module_platform_driver_probe() this is ok because they cannot get unbound at
309+
* runtime. So mark the driver struct with __refdata to prevent modpost
310+
* triggering a section mismatch warning.
311+
*/
312+
static struct platform_driver mv_rtc_driver __refdata = {
307313
.remove = __exit_p(mv_rtc_remove),
308314
.driver = {
309315
.name = "rtc-mv",

0 commit comments

Comments
 (0)