Linux-RTC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] rtc: bd70528: fix driver dependencies
@ 2019-08-12  6:36 Matti Vaittinen
  2019-08-12 21:02 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Matti Vaittinen @ 2019-08-12  6:36 UTC (permalink / raw)
  To: matti.vaittinen, mazziesaccount
  Cc: Alessandro Zummo, Alexandre Belloni, linux-rtc, linux-kernel,
	Randy Dunlap, Lee Jones, Arnd Bergmann, yuehaibing

With CONFIG_BD70528_WATCHDOG=m, a built-in rtc driver cannot call
into the low-level functions that are part of the watchdog module:

drivers/rtc/rtc-bd70528.o: In function `bd70528_set_time':
rtc-bd70528.c:(.text+0x22c): undefined reference to `bd70528_wdt_lock'
rtc-bd70528.c:(.text+0x2a8): undefined reference to `bd70528_wdt_unlock'
drivers/rtc/rtc-bd70528.o: In function `bd70528_set_rtc_based_timers':
rtc-bd70528.c:(.text+0x50c): undefined reference to `bd70528_wdt_set'

Add a Kconfig dependency which forces RTC to be a module if watchdog is a
module. If watchdog is not compiled at all the stub functions for watchdog
control are used. compiling the RTC without watchdog is fine.

Fixes: 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC")
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
---
 Issue was found by kbuildbot from linux-next. Issue was addressed by
 Arnd and Randy - but those solutions disallowed compiling the RTC
 without watchdog. This patch is a result of discussion with Arnd and it
 was created on top of Linus' tree (tag v5.3-rc4).
 drivers/rtc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index e72f65b61176..add43c337489 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -500,6 +500,7 @@ config RTC_DRV_M41T80_WDT
 	  watchdog timer in the ST M41T60 and M41T80 RTC chips series.
 config RTC_DRV_BD70528
 	tristate "ROHM BD70528 PMIC RTC"
+	depends on MFD_ROHM_BD70528 && (BD70528_WATCHDOG || !BD70528_WATCHDOG)
 	help
 	  If you say Y here you will get support for the RTC
 	  on ROHM BD70528 Power Management IC.
-- 
2.17.2


-- 
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =] 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtc: bd70528: fix driver dependencies
  2019-08-12  6:36 [PATCH] rtc: bd70528: fix driver dependencies Matti Vaittinen
@ 2019-08-12 21:02 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2019-08-12 21:02 UTC (permalink / raw)
  To: Matti Vaittinen
  Cc: mazziesaccount, Alessandro Zummo, linux-rtc, linux-kernel,
	Randy Dunlap, Lee Jones, Arnd Bergmann, yuehaibing

On 12/08/2019 09:36:11+0300, Matti Vaittinen wrote:
> With CONFIG_BD70528_WATCHDOG=m, a built-in rtc driver cannot call
> into the low-level functions that are part of the watchdog module:
> 
> drivers/rtc/rtc-bd70528.o: In function `bd70528_set_time':
> rtc-bd70528.c:(.text+0x22c): undefined reference to `bd70528_wdt_lock'
> rtc-bd70528.c:(.text+0x2a8): undefined reference to `bd70528_wdt_unlock'
> drivers/rtc/rtc-bd70528.o: In function `bd70528_set_rtc_based_timers':
> rtc-bd70528.c:(.text+0x50c): undefined reference to `bd70528_wdt_set'
> 
> Add a Kconfig dependency which forces RTC to be a module if watchdog is a
> module. If watchdog is not compiled at all the stub functions for watchdog
> control are used. compiling the RTC without watchdog is fine.
> 
> Fixes: 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC")
> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> ---
>  Issue was found by kbuildbot from linux-next. Issue was addressed by
>  Arnd and Randy - but those solutions disallowed compiling the RTC
>  without watchdog. This patch is a result of discussion with Arnd and it
>  was created on top of Linus' tree (tag v5.3-rc4).
>  drivers/rtc/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12  6:36 [PATCH] rtc: bd70528: fix driver dependencies Matti Vaittinen
2019-08-12 21:02 ` Alexandre Belloni

Linux-RTC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rtc/0 linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ https://lore.kernel.org/linux-rtc \
		linux-rtc@vger.kernel.org linux-rtc@archiver.kernel.org
	public-inbox-index linux-rtc


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rtc


AGPL code for this site: git clone https://public-inbox.org/ public-inbox