rtc: pcf2127: move watchdog initialisation to a separate function
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 24 Sep 2020 10:52:55 +0000 (12:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Jan 2021 12:46:22 +0000 (13:46 +0100)
commitacb821425c8cc5a4b688c973446cde356a04923a
tree464780f1670a2beab2514c395df2ac1c4f3b92c5
parentb00195241186db6e2fb5698afe67971b05b1a959
rtc: pcf2127: move watchdog initialisation to a separate function

commit 5d78533a0c53af9659227c803df944ba27cd56e0 upstream.

The obvious advantages are:

 - The linker can drop the watchdog functions if CONFIG_WATCHDOG is off.
 - All watchdog stuff grouped together with only a single function call
   left in generic code.
 - Watchdog register is only read when it is actually used.
 - Less #ifdefery

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200924105256.18162-2-u.kleine-koenig@pengutronix.de
Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/rtc-pcf2127.c