Skip to content

Commit e6d4430

Browse files
Uwe Kleine-Königalexandrebelloni
authored andcommitted
rtc: imxdi: 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 5dbde07 commit e6d4430

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/rtc/rtc-imxdi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,13 @@ static const struct of_device_id dryice_dt_ids[] = {
851851

852852
MODULE_DEVICE_TABLE(of, dryice_dt_ids);
853853

854-
static struct platform_driver dryice_rtc_driver = {
854+
/*
855+
* dryice_rtc_remove() lives in .exit.text. For drivers registered via
856+
* module_platform_driver_probe() this is ok because they cannot get unbound at
857+
* runtime. So mark the driver struct with __refdata to prevent modpost
858+
* triggering a section mismatch warning.
859+
*/
860+
static struct platform_driver dryice_rtc_driver __refdata = {
855861
.driver = {
856862
.name = "imxdi_rtc",
857863
.of_match_table = dryice_dt_ids,

0 commit comments

Comments
 (0)