]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: rx8010: don't modify the global rtc ops
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 14 Sep 2020 15:45:48 +0000 (17:45 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 15 Sep 2020 08:50:37 +0000 (10:50 +0200)
commit7575caa7d8e87425a61c36855fc74a19aff313cc
tree7ea9fbc6db0e01c9759b898c956020334ad63851
parentb653bd7d92f5df0a32dd7cf33aed9f2f7cdb203f
rtc: rx8010: don't modify the global rtc ops

The way the driver is implemented is buggy for the (admittedly unlikely)
use case where there are two RTCs with one having an interrupt configured
and the second not. This is caused by the fact that we use a global
rtc_class_ops struct which we modify depending on whether the irq number
is present or not.

Fix it by using two const ops structs with and without alarm operations.
While at it: not being able to request a configured interrupt is an error
so don't ignore it and bail out of probe().

Fixes: acad41d7343d ("rtc: Add Epson RX8010SJ RTC driver")
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200914154601.32245-2-brgl@bgdev.pl
drivers/rtc/rtc-rx8010.c