Skip to contentSkip to conversation

rtc: davinci: remove incorrect reference to probe function

PATCH Applied Arnd Bergmann 2 participants 2 messages Oct 12, 2015 – Oct 18, 2015 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: davinci: remove incorrect reference to probe function

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.

drivers/rtc/rtc-davinci.c +0 -1
index c84f46168a52..c5432bf64e1c 100644
@@ -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",
#1 lore raw
Quoted 8 lines · Arnd Bergmann

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:

Quoted 8 lines

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.

Applied, thanks.

Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com