Re: [PATCH] rtc: rtc-puv3: Add __devinit and __devexit markers forprobe and remove

From: Michal Marek
Date: Fri Oct 21 2011 - 04:32:35 EST


On 18.10.2011 09:22, Guan Xuetao wrote:
> Hi Axel,
> The patch yield following warnings:
>
> WARNING: drivers/rtc/built-in.o(.data+0x90): Section mismatch in
> reference from the variable puv3_rtcdrv to the
> function .devinit.text:puv3_rtc_probe()
> The variable puv3_rtcdrv references
> the function __devinit puv3_rtc_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the
> variable:
> *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one,
> *_console
[...]
>
> For puv3_rtc_probe, I think it should be in the white-list, but warnings
> are yielded.
> For puv3_rtc_remove, the warning could be disappeared by modifying
> __devexit to __exit, however is it proper?

The warning message tries to hint at the solution. Just name the variable

static struct platform_driver puv3_rtc_driver

and modpost will know that this is simply a list of pointers to driver
functions, in which case the section mismatch is OK (the init function
will only be called at init time).

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/