]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:08:54 +0000 (11:08 +0100)
commit90553a7466d0bf67ed67d84c5ea01bf6fc9c821a
tree86fe5d1932467c87ffe4966e8420c93ab77414a0
parent36beb0e4d553671273710890e9357aaebc996f36
rtc: rx8010: don't modify the global rtc ops

commit d3b14296da69adb7825022f3224ac6137eb30abf upstream.

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: ed13d89b08e3 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/rtc-rx8010.c