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)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 27 Oct 2020 11:18:28 +0000 (12:18 +0100)
commit5d78533a0c53af9659227c803df944ba27cd56e0
tree3c8e37b0013d3dc5e6192ccaec3eb56349c2a9ca
parent3650b228f83adda7e5ee532e2b90429c03f7b9ec
rtc: pcf2127: move watchdog initialisation to a separate function

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
drivers/rtc/rtc-pcf2127.c