* [PATCH] rtc: asm9260: remove incorrect __init/__exit annotations
@ 2016-03-15 21:44 Arnd Bergmann
2016-03-16 9:30 ` Alexandre Belloni
2016-03-18 23:05 ` Alexandre Belloni
0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-03-15 21:44 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Arnd Bergmann, Alessandro Zummo, Oleksij Rempel, rtc-linux,
linux-kernel
The probe and remove callbacks of the platform driver are marked __init
and __exit, respectively. However, this is not a correct way to annotate
them, as it will result in those sections to be discarded at link time
or after boot, while we can actually call them again based on manual
unbinding, or deferred probing.
Kbuild warns about the problem:
WARNING: drivers/rtc/rtc-asm9260.o(.data+0x0): Section mismatch in reference from the variable asm9260_rtc_driver to the function .init.text:asm9260_rtc_probe()
This removes the annotations, so we no longer branch into missing
code and avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 125e550fd257 ("rtc: add Alphascale asm9260 driver")
---
drivers/rtc/rtc-asm9260.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-asm9260.c b/drivers/rtc/rtc-asm9260.c
index 14e08c4c1a01..355fdb97a006 100644
--- a/drivers/rtc/rtc-asm9260.c
+++ b/drivers/rtc/rtc-asm9260.c
@@ -255,7 +255,7 @@ static const struct rtc_class_ops asm9260_rtc_ops = {
.alarm_irq_enable = asm9260_alarm_irq_enable,
};
-static int __init asm9260_rtc_probe(struct platform_device *pdev)
+static int asm9260_rtc_probe(struct platform_device *pdev)
{
struct asm9260_rtc_priv *priv;
struct device *dev = &pdev->dev;
@@ -323,7 +323,7 @@ err_return:
return ret;
}
-static int __exit asm9260_rtc_remove(struct platform_device *pdev)
+static int asm9260_rtc_remove(struct platform_device *pdev)
{
struct asm9260_rtc_priv *priv = platform_get_drvdata(pdev);
--
2.7.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] rtc: asm9260: remove incorrect __init/__exit annotations
2016-03-15 21:44 [PATCH] rtc: asm9260: remove incorrect __init/__exit annotations Arnd Bergmann
@ 2016-03-16 9:30 ` Alexandre Belloni
2016-03-16 9:33 ` Oleksij Rempel
2016-03-18 23:05 ` Alexandre Belloni
1 sibling, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2016-03-16 9:30 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Alessandro Zummo, Oleksij Rempel, rtc-linux, linux-kernel
Hi,
On 15/03/2016 at 22:44:31 +0100, Arnd Bergmann wrote :
> The probe and remove callbacks of the platform driver are marked __init
> and __exit, respectively. However, this is not a correct way to annotate
> them, as it will result in those sections to be discarded at link time
> or after boot, while we can actually call them again based on manual
> unbinding, or deferred probing.
>
> Kbuild warns about the problem:
>
> WARNING: drivers/rtc/rtc-asm9260.o(.data+0x0): Section mismatch in reference from the variable asm9260_rtc_driver to the function .init.text:asm9260_rtc_probe()
>
I'm not sure why this was not caught before. I'm not building all the
platform but that one should have been easy to find...
> This removes the annotations, so we no longer branch into missing
> code and avoid the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 125e550fd257 ("rtc: add Alphascale asm9260 driver")
> ---
> drivers/rtc/rtc-asm9260.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/rtc/rtc-asm9260.c b/drivers/rtc/rtc-asm9260.c
> index 14e08c4c1a01..355fdb97a006 100644
> --- a/drivers/rtc/rtc-asm9260.c
> +++ b/drivers/rtc/rtc-asm9260.c
> @@ -255,7 +255,7 @@ static const struct rtc_class_ops asm9260_rtc_ops = {
> .alarm_irq_enable = asm9260_alarm_irq_enable,
> };
>
> -static int __init asm9260_rtc_probe(struct platform_device *pdev)
> +static int asm9260_rtc_probe(struct platform_device *pdev)
> {
> struct asm9260_rtc_priv *priv;
> struct device *dev = &pdev->dev;
> @@ -323,7 +323,7 @@ err_return:
> return ret;
> }
>
> -static int __exit asm9260_rtc_remove(struct platform_device *pdev)
> +static int asm9260_rtc_remove(struct platform_device *pdev)
> {
> struct asm9260_rtc_priv *priv = platform_get_drvdata(pdev);
>
> --
> 2.7.0
>
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] rtc: asm9260: remove incorrect __init/__exit annotations
2016-03-16 9:30 ` Alexandre Belloni
@ 2016-03-16 9:33 ` Oleksij Rempel
0 siblings, 0 replies; 4+ messages in thread
From: Oleksij Rempel @ 2016-03-16 9:33 UTC (permalink / raw)
To: Alexandre Belloni, Arnd Bergmann
Cc: Alessandro Zummo, rtc-linux, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 2095 bytes --]
Am 16.03.2016 um 10:30 schrieb Alexandre Belloni:
> Hi,
>
> On 15/03/2016 at 22:44:31 +0100, Arnd Bergmann wrote :
>> The probe and remove callbacks of the platform driver are marked __init
>> and __exit, respectively. However, this is not a correct way to annotate
>> them, as it will result in those sections to be discarded at link time
>> or after boot, while we can actually call them again based on manual
>> unbinding, or deferred probing.
>>
>> Kbuild warns about the problem:
>>
>> WARNING: drivers/rtc/rtc-asm9260.o(.data+0x0): Section mismatch in reference from the variable asm9260_rtc_driver to the function .init.text:asm9260_rtc_probe()
>>
>
> I'm not sure why this was not caught before. I'm not building all the
> platform but that one should have been easy to find...
Sorry, i'm working on monolit kernel. Haven't seen this warning before :(
>> This removes the annotations, so we no longer branch into missing
>> code and avoid the warning.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Fixes: 125e550fd257 ("rtc: add Alphascale asm9260 driver")
>> ---
>> drivers/rtc/rtc-asm9260.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/rtc/rtc-asm9260.c b/drivers/rtc/rtc-asm9260.c
>> index 14e08c4c1a01..355fdb97a006 100644
>> --- a/drivers/rtc/rtc-asm9260.c
>> +++ b/drivers/rtc/rtc-asm9260.c
>> @@ -255,7 +255,7 @@ static const struct rtc_class_ops asm9260_rtc_ops = {
>> .alarm_irq_enable = asm9260_alarm_irq_enable,
>> };
>>
>> -static int __init asm9260_rtc_probe(struct platform_device *pdev)
>> +static int asm9260_rtc_probe(struct platform_device *pdev)
>> {
>> struct asm9260_rtc_priv *priv;
>> struct device *dev = &pdev->dev;
>> @@ -323,7 +323,7 @@ err_return:
>> return ret;
>> }
>>
>> -static int __exit asm9260_rtc_remove(struct platform_device *pdev)
>> +static int asm9260_rtc_remove(struct platform_device *pdev)
>> {
>> struct asm9260_rtc_priv *priv = platform_get_drvdata(pdev);
>>
>> --
>> 2.7.0
>>
>
--
Regards,
Oleksij
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rtc: asm9260: remove incorrect __init/__exit annotations
2016-03-15 21:44 [PATCH] rtc: asm9260: remove incorrect __init/__exit annotations Arnd Bergmann
2016-03-16 9:30 ` Alexandre Belloni
@ 2016-03-18 23:05 ` Alexandre Belloni
1 sibling, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2016-03-18 23:05 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Alessandro Zummo, Oleksij Rempel, rtc-linux, linux-kernel
On 15/03/2016 at 22:44:31 +0100, Arnd Bergmann wrote :
> The probe and remove callbacks of the platform driver are marked __init
> and __exit, respectively. However, this is not a correct way to annotate
> them, as it will result in those sections to be discarded at link time
> or after boot, while we can actually call them again based on manual
> unbinding, or deferred probing.
>
> Kbuild warns about the problem:
>
> WARNING: drivers/rtc/rtc-asm9260.o(.data+0x0): Section mismatch in reference from the variable asm9260_rtc_driver to the function .init.text:asm9260_rtc_probe()
>
> This removes the annotations, so we no longer branch into missing
> code and avoid the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 125e550fd257 ("rtc: add Alphascale asm9260 driver")
> ---
> drivers/rtc/rtc-asm9260.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Applied, thanks.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-18 23:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-15 21:44 [PATCH] rtc: asm9260: remove incorrect __init/__exit annotations Arnd Bergmann
2016-03-16 9:30 ` Alexandre Belloni
2016-03-16 9:33 ` Oleksij Rempel
2016-03-18 23:05 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox