* [rtc-linux] [PATCH] rtc: davinci: remove incorrect reference to probe function
@ 2015-10-12 13:14 Arnd Bergmann
2015-10-18 0:15 ` [rtc-linux] " Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2015-10-12 13:14 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Alessandro Zummo, rtc-linux, linux-kernel, linux-arm-kernel,
Sekhar Nori, Kevin Hilman, Miguel Aguilar
The davinci rtc driver uses the module_platform_driver_probe()
helper to call the probe function and mark it as __init, but
it also puts a reference into its davinci_rtc_driver function.
This will crash if we ever get a deferred probe and the probe
function is called again after the init section has been removed.
kbuild warns about this:
WARNING: vmlinux.o(.data+0x1aa2b4): Section mismatch in reference from the variable davinci_rtc_driver to the function .init.text:davinci_rtc_probe()
The variable davinci_rtc_driver references
the function __init davinci_rtc_probe()
This patch removes the .probe callback from the platform driver,
which avoids those problems.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c
index c84f46168a52..c5432bf64e1c 100644
--- a/drivers/rtc/rtc-davinci.c
+++ b/drivers/rtc/rtc-davinci.c
@@ -546,7 +546,6 @@ static int __exit davinci_rtc_remove(struct platform_device *pdev)
}
static struct platform_driver davinci_rtc_driver = {
- .probe = davinci_rtc_probe,
.remove = __exit_p(davinci_rtc_remove),
.driver = {
.name = "rtc_davinci",
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [rtc-linux] Re: [PATCH] rtc: davinci: remove incorrect reference to probe function
2015-10-12 13:14 [rtc-linux] [PATCH] rtc: davinci: remove incorrect reference to probe function Arnd Bergmann
@ 2015-10-18 0:15 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2015-10-18 0:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Alessandro Zummo, rtc-linux, linux-kernel, linux-arm-kernel,
Sekhar Nori, Kevin Hilman, Miguel Aguilar
On 12/10/2015 at 15:14:05 +0200, Arnd Bergmann wrote :
> The davinci rtc driver uses the module_platform_driver_probe()
> helper to call the probe function and mark it as __init, but
> it also puts a reference into its davinci_rtc_driver function.
>
> This will crash if we ever get a deferred probe and the probe
> function is called again after the init section has been removed.
> kbuild warns about this:
>
> WARNING: vmlinux.o(.data+0x1aa2b4): Section mismatch in reference from the variable davinci_rtc_driver to the function .init.text:davinci_rtc_probe()
> The variable davinci_rtc_driver references
> the function __init davinci_rtc_probe()
>
> This patch removes the .probe callback from the platform driver,
> which avoids those problems.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thanks.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-18 0:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-12 13:14 [rtc-linux] [PATCH] rtc: davinci: remove incorrect reference to probe function Arnd Bergmann
2015-10-18 0:15 ` [rtc-linux] " Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox