]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: twl: Fix registration vs. init order
authorTodd Poynor <toddpoynor@google.com>
Thu, 11 Aug 2011 03:20:36 +0000 (20:20 -0700)
committerJohn Stultz <john.stultz@linaro.org>
Sat, 27 Aug 2011 00:26:54 +0000 (17:26 -0700)
commitfd1d471f0dc5b5dab6d4b34712b2d5cb2e2a4681
tree02d26d0499a1510efa3e15ff57046ad35955f84c
parentc6fa80c61036171606c1484c714fffbf777af855
rtc: twl: Fix registration vs. init order

Only register as an RTC device after the hardware has been
successfully initialized.  The RTC class driver will call
back to this driver to read a pending alarm, and other
drivers watching for new devices on the RTC class may
read the RTC time upon registration.  Such access might
occur while the RTC is stopped, prior to clearing
pending alarms, etc.

The new ordering also avoids leaving the platform
device drvdata set to an unregistered struct rtc_device *
on probe errors.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
drivers/rtc/rtc-twl.c