rtc: ds1685: fix possible race condition
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 31 May 2018 09:56:42 +0000 (11:56 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 31 May 2018 21:02:11 +0000 (23:02 +0200)
commita2ae8323a8e2c5668ae42493d925da1d68ff0324
treed423ff31f0615f0b5758d0bf211b6fe5ae859852
parenta0defd7cfc2804796144545e00aaf74a486adbe7
rtc: ds1685: fix possible race condition

The IRQ is requested before the struct rtc is allocated and registered, but
this struct is used in the IRQ handler.

Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc
before requesting the IRQ.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ds1685.c