Commit b0ddc5b1 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Alexandre Belloni

rtc: bd70528: fix BD71815 watchdog dependency

The added Kconfig dependency is slightly incorrect, which can
lead to a link failure when the watchdog is a loadable module:

arm-linux-gnueabi-ld: drivers/rtc/rtc-bd70528.o: in function `bd70528_set_rtc_based_timers':
rtc-bd70528.c:(.text+0x6cc): undefined reference to `bd70528_wdt_set'
arm-linux-gnueabi-ld: drivers/rtc/rtc-bd70528.o: in function `bd70528_set_time':
rtc-bd70528.c:(.text+0xaa0): undefined reference to `bd70528_wdt_lock'
arm-linux-gnueabi-ld: rtc-bd70528.c:(.text+0xab8): undefined reference to `bd70528_wdt_unlock'
arm-linux-gnueabi-ld: drivers/rtc/rtc-bd70528.o: in function `bd70528_alm_enable':
rtc-bd70528.c:(.text+0xfc0): undefined reference to `bd70528_wdt_lock'
arm-linux-gnueabi-ld: rtc-bd70528.c:(.text+0x1030): undefined reference to `bd70528_wdt_unlock'

The problem is that it allows to be built-in if MFD_ROHM_BD71828
is built-in, even when the watchdog is a loadable module.

Rework this so that having the watchdog as a loadable module always
forces the rtc to be a module as well instead of built-in,
regardless of bd71828.

Fixes: c56dc069 ("rtc: bd70528: Support RTC on ROHM BD71815")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210422151545.2403356-1-arnd@kernel.org
parent 6efb943b
...@@ -502,7 +502,8 @@ config RTC_DRV_M41T80_WDT ...@@ -502,7 +502,8 @@ config RTC_DRV_M41T80_WDT
config RTC_DRV_BD70528 config RTC_DRV_BD70528
tristate "ROHM BD70528, BD71815 and BD71828 PMIC RTC" tristate "ROHM BD70528, BD71815 and BD71828 PMIC RTC"
depends on MFD_ROHM_BD71828 || MFD_ROHM_BD70528 && (BD70528_WATCHDOG || !BD70528_WATCHDOG) depends on MFD_ROHM_BD71828 || MFD_ROHM_BD70528
depends on BD70528_WATCHDOG || !BD70528_WATCHDOG
help help
If you say Y here you will get support for the RTC If you say Y here you will get support for the RTC
block on ROHM BD70528, BD71815 and BD71828 Power Management IC. block on ROHM BD70528, BD71815 and BD71828 Power Management IC.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment