summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-da9063.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2020-08-14 14:07:30 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2020-08-21 01:13:44 +0300
commitf65e727464d7c0090f05548e8f323779eaa97eda (patch)
tree6888ab3c2489bdb86fb23cdf8df2ec9e2cee891f /drivers/rtc/rtc-da9063.c
parentfc9656a370499e5a32425b715f8fed241e832458 (diff)
downloadlinux-f65e727464d7c0090f05548e8f323779eaa97eda.tar.xz
rtc: rtc-rs5c313: Fix late hardware init
rs5c313_rtc_init() calls platform_driver_register(), and initializes the hardware. This is wrong because of two reasons: 1. As soon as the driver has been registered, the device may be probed. If devm_rtc_device_register() is called before hardware initialization, reading the current time will fail: rs5c313 rs5c313: rs5c313_rtc_read_time: timeout error rs5c313 rs5c313: registered as rtc0 rs5c313 rs5c313: rs5c313_rtc_read_time: timeout error rs5c313 rs5c313: hctosys: unable to read the hardware clock 2. If the platform device does not exist, the driver will still write to a hardware device that may not be present. Fix this by moving the hardware initialization sequence to the driver's .probe() method. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20200814110731.29029-3-geert+renesas@glider.be
Diffstat (limited to 'drivers/rtc/rtc-da9063.c')
0 files changed, 0 insertions, 0 deletions