linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE
@ 2019-08-23 12:45 YueHaibing
  2019-08-23 13:38 ` Guenter Roeck
  2019-08-23 14:05 ` Alexandre Belloni
  0 siblings, 2 replies; 9+ messages in thread
From: YueHaibing @ 2019-08-23 12:45 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni, bruno.thomsen, linux
  Cc: linux-rtc, linux-kernel, YueHaibing

If WATCHDOG_CORE is not set, build fails:

drivers/rtc/rtc-pcf2127.o: In function `pcf2127_probe.isra.6':
drivers/rtc/rtc-pcf2127.c:478: undefined reference to `devm_watchdog_register_device'

Add WATCHDOG_CORE Kconfig dependency to fix this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: bbc597561ce1 ("rtc: pcf2127: add watchdog feature support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/rtc/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 25af63d..9dce7dc 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -886,6 +886,8 @@ config RTC_DRV_DS3232_HWMON
 config RTC_DRV_PCF2127
 	tristate "NXP PCF2127"
 	depends on RTC_I2C_AND_SPI
+	depends on WATCHDOG
+	select WATCHDOG_CORE
 	help
 	  If you say yes here you get support for the NXP PCF2127/29 RTC
 	  chips with integrated quartz crystal for industrial applications.
-- 
2.7.4



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

* Re: [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE
  2019-08-23 12:45 [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE YueHaibing
@ 2019-08-23 13:38 ` Guenter Roeck
  2019-08-23 14:05 ` Alexandre Belloni
  1 sibling, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2019-08-23 13:38 UTC (permalink / raw)
  To: YueHaibing, a.zummo, alexandre.belloni, bruno.thomsen
  Cc: linux-rtc, linux-kernel

On 8/23/19 5:45 AM, YueHaibing wrote:
> If WATCHDOG_CORE is not set, build fails:
> 
> drivers/rtc/rtc-pcf2127.o: In function `pcf2127_probe.isra.6':
> drivers/rtc/rtc-pcf2127.c:478: undefined reference to `devm_watchdog_register_device'
> 
> Add WATCHDOG_CORE Kconfig dependency to fix this.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: bbc597561ce1 ("rtc: pcf2127: add watchdog feature support")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/rtc/Kconfig | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index 25af63d..9dce7dc 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -886,6 +886,8 @@ config RTC_DRV_DS3232_HWMON
>   config RTC_DRV_PCF2127
>   	tristate "NXP PCF2127"
>   	depends on RTC_I2C_AND_SPI
> +	depends on WATCHDOG
> +	select WATCHDOG_CORE
>   	help
>   	  If you say yes here you get support for the NXP PCF2127/29 RTC
>   	  chips with integrated quartz crystal for industrial applications.
> 


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

* Re: [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE
  2019-08-23 12:45 [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE YueHaibing
  2019-08-23 13:38 ` Guenter Roeck
@ 2019-08-23 14:05 ` Alexandre Belloni
  2019-08-26  8:12   ` Yuehaibing
  2019-08-28 17:18   ` Randy Dunlap
  1 sibling, 2 replies; 9+ messages in thread
From: Alexandre Belloni @ 2019-08-23 14:05 UTC (permalink / raw)
  To: YueHaibing; +Cc: a.zummo, bruno.thomsen, linux, linux-rtc, linux-kernel

On 23/08/2019 20:45:53+0800, YueHaibing wrote:
> If WATCHDOG_CORE is not set, build fails:
> 
> drivers/rtc/rtc-pcf2127.o: In function `pcf2127_probe.isra.6':
> drivers/rtc/rtc-pcf2127.c:478: undefined reference to `devm_watchdog_register_device'
> 
> Add WATCHDOG_CORE Kconfig dependency to fix this.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: bbc597561ce1 ("rtc: pcf2127: add watchdog feature support")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/rtc/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index 25af63d..9dce7dc 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -886,6 +886,8 @@ config RTC_DRV_DS3232_HWMON
>  config RTC_DRV_PCF2127
>  	tristate "NXP PCF2127"
>  	depends on RTC_I2C_AND_SPI
> +	depends on WATCHDOG

Definitively not, I fixed it that way:
+       select WATCHDOG_CORE if WATCHDOG


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

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

* Re: [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE
  2019-08-23 14:05 ` Alexandre Belloni
@ 2019-08-26  8:12   ` Yuehaibing
  2019-08-26 13:20     ` Guenter Roeck
  2019-08-28 17:18   ` Randy Dunlap
  1 sibling, 1 reply; 9+ messages in thread
From: Yuehaibing @ 2019-08-26  8:12 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: a.zummo, bruno.thomsen, linux, linux-rtc, linux-kernel



On 2019/8/23 22:05, Alexandre Belloni wrote:
> On 23/08/2019 20:45:53+0800, YueHaibing wrote:
>> If WATCHDOG_CORE is not set, build fails:
>>
>> drivers/rtc/rtc-pcf2127.o: In function `pcf2127_probe.isra.6':
>> drivers/rtc/rtc-pcf2127.c:478: undefined reference to `devm_watchdog_register_device'
>>
>> Add WATCHDOG_CORE Kconfig dependency to fix this.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Fixes: bbc597561ce1 ("rtc: pcf2127: add watchdog feature support")
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  drivers/rtc/Kconfig | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
>> index 25af63d..9dce7dc 100644
>> --- a/drivers/rtc/Kconfig
>> +++ b/drivers/rtc/Kconfig
>> @@ -886,6 +886,8 @@ config RTC_DRV_DS3232_HWMON
>>  config RTC_DRV_PCF2127
>>  	tristate "NXP PCF2127"
>>  	depends on RTC_I2C_AND_SPI
>> +	depends on WATCHDOG
> 
> Definitively not, I fixed it that way:
> +       select WATCHDOG_CORE if WATCHDOG


No, this still fails while WATCHDOG is not set

> 
> 


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

* Re: [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE
  2019-08-26  8:12   ` Yuehaibing
@ 2019-08-26 13:20     ` Guenter Roeck
  2019-08-26 18:13       ` Bruno Thomsen
  0 siblings, 1 reply; 9+ messages in thread
From: Guenter Roeck @ 2019-08-26 13:20 UTC (permalink / raw)
  To: Yuehaibing, Alexandre Belloni
  Cc: a.zummo, bruno.thomsen, linux-rtc, linux-kernel

On 8/26/19 1:12 AM, Yuehaibing wrote:
> 
> 
> On 2019/8/23 22:05, Alexandre Belloni wrote:
>> On 23/08/2019 20:45:53+0800, YueHaibing wrote:
>>> If WATCHDOG_CORE is not set, build fails:
>>>
>>> drivers/rtc/rtc-pcf2127.o: In function `pcf2127_probe.isra.6':
>>> drivers/rtc/rtc-pcf2127.c:478: undefined reference to `devm_watchdog_register_device'
>>>
>>> Add WATCHDOG_CORE Kconfig dependency to fix this.
>>>
>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>> Fixes: bbc597561ce1 ("rtc: pcf2127: add watchdog feature support")
>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>> ---
>>>   drivers/rtc/Kconfig | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
>>> index 25af63d..9dce7dc 100644
>>> --- a/drivers/rtc/Kconfig
>>> +++ b/drivers/rtc/Kconfig
>>> @@ -886,6 +886,8 @@ config RTC_DRV_DS3232_HWMON
>>>   config RTC_DRV_PCF2127
>>>   	tristate "NXP PCF2127"
>>>   	depends on RTC_I2C_AND_SPI
>>> +	depends on WATCHDOG
>>
>> Definitively not, I fixed it that way:
>> +       select WATCHDOG_CORE if WATCHDOG
> 
> 
> No, this still fails while WATCHDOG is not set
> 

Correct, there are no dummy functions for watchdog device registration.
There would have to be conditional code in the driver if the watchdog
is supposed to be optional.

Guenter

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

* Re: [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE
  2019-08-26 13:20     ` Guenter Roeck
@ 2019-08-26 18:13       ` Bruno Thomsen
  2019-08-26 18:46         ` Guenter Roeck
  0 siblings, 1 reply; 9+ messages in thread
From: Bruno Thomsen @ 2019-08-26 18:13 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Yuehaibing, Alexandre Belloni, a.zummo, linux-rtc, linux-kernel

Den man. 26. aug. 2019 kl. 15.20 skrev Guenter Roeck <linux@roeck-us.net>:
>
> On 8/26/19 1:12 AM, Yuehaibing wrote:
> >
> >
> > On 2019/8/23 22:05, Alexandre Belloni wrote:
> >> On 23/08/2019 20:45:53+0800, YueHaibing wrote:
> >>> If WATCHDOG_CORE is not set, build fails:
> >>>
> >>> drivers/rtc/rtc-pcf2127.o: In function `pcf2127_probe.isra.6':
> >>> drivers/rtc/rtc-pcf2127.c:478: undefined reference to `devm_watchdog_register_device'
> >>>
> >>> Add WATCHDOG_CORE Kconfig dependency to fix this.
> >>>
> >>> Reported-by: Hulk Robot <hulkci@huawei.com>
> >>> Fixes: bbc597561ce1 ("rtc: pcf2127: add watchdog feature support")
> >>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> >>> ---
> >>>   drivers/rtc/Kconfig | 2 ++
> >>>   1 file changed, 2 insertions(+)
> >>>
> >>> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> >>> index 25af63d..9dce7dc 100644
> >>> --- a/drivers/rtc/Kconfig
> >>> +++ b/drivers/rtc/Kconfig
> >>> @@ -886,6 +886,8 @@ config RTC_DRV_DS3232_HWMON
> >>>   config RTC_DRV_PCF2127
> >>>     tristate "NXP PCF2127"
> >>>     depends on RTC_I2C_AND_SPI
> >>> +   depends on WATCHDOG
> >>
> >> Definitively not, I fixed it that way:
> >> +       select WATCHDOG_CORE if WATCHDOG
> >
> >
> > No, this still fails while WATCHDOG is not set
> >
>
> Correct, there are no dummy functions for watchdog device registration.
> There would have to be conditional code in the driver if the watchdog
> is supposed to be optional.

Hi

During review of version 1, there was a wish for the watchdog feature not
to be hidden behind Kconfig option, e.g. RTC_DRV_PCF2127_WDT, as
it would not result in a much bigger driver.

I did not add any other selects/depends on in Kconfig as
RTC_DRV_DS1374_WDT and RTC_DRV_M41T80_WDT options
does not select WATCHDOG_CORE and/or WATCHDOG either.
DS1374 and M41T80 does not seem to check on any other
WATCHDOG defines other then their _WDT Kconfig.

I can create a patch that hides the watchdog code if WATCHDOG
define is not set, if that's the right way?

Bruno

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

* Re: [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE
  2019-08-26 18:13       ` Bruno Thomsen
@ 2019-08-26 18:46         ` Guenter Roeck
  0 siblings, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2019-08-26 18:46 UTC (permalink / raw)
  To: Bruno Thomsen
  Cc: Yuehaibing, Alexandre Belloni, a.zummo, linux-rtc, linux-kernel

On Mon, Aug 26, 2019 at 08:13:35PM +0200, Bruno Thomsen wrote:
> Den man. 26. aug. 2019 kl. 15.20 skrev Guenter Roeck <linux@roeck-us.net>:
> >
> > On 8/26/19 1:12 AM, Yuehaibing wrote:
> > >
> > >
> > > On 2019/8/23 22:05, Alexandre Belloni wrote:
> > >> On 23/08/2019 20:45:53+0800, YueHaibing wrote:
> > >>> If WATCHDOG_CORE is not set, build fails:
> > >>>
> > >>> drivers/rtc/rtc-pcf2127.o: In function `pcf2127_probe.isra.6':
> > >>> drivers/rtc/rtc-pcf2127.c:478: undefined reference to `devm_watchdog_register_device'
> > >>>
> > >>> Add WATCHDOG_CORE Kconfig dependency to fix this.
> > >>>
> > >>> Reported-by: Hulk Robot <hulkci@huawei.com>
> > >>> Fixes: bbc597561ce1 ("rtc: pcf2127: add watchdog feature support")
> > >>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > >>> ---
> > >>>   drivers/rtc/Kconfig | 2 ++
> > >>>   1 file changed, 2 insertions(+)
> > >>>
> > >>> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> > >>> index 25af63d..9dce7dc 100644
> > >>> --- a/drivers/rtc/Kconfig
> > >>> +++ b/drivers/rtc/Kconfig
> > >>> @@ -886,6 +886,8 @@ config RTC_DRV_DS3232_HWMON
> > >>>   config RTC_DRV_PCF2127
> > >>>     tristate "NXP PCF2127"
> > >>>     depends on RTC_I2C_AND_SPI
> > >>> +   depends on WATCHDOG
> > >>
> > >> Definitively not, I fixed it that way:
> > >> +       select WATCHDOG_CORE if WATCHDOG
> > >
> > >
> > > No, this still fails while WATCHDOG is not set
> > >
> >
> > Correct, there are no dummy functions for watchdog device registration.
> > There would have to be conditional code in the driver if the watchdog
> > is supposed to be optional.
> 
> Hi
> 
> During review of version 1, there was a wish for the watchdog feature not
> to be hidden behind Kconfig option, e.g. RTC_DRV_PCF2127_WDT, as
> it would not result in a much bigger driver.
> 
> I did not add any other selects/depends on in Kconfig as
> RTC_DRV_DS1374_WDT and RTC_DRV_M41T80_WDT options
> does not select WATCHDOG_CORE and/or WATCHDOG either.

Those drivers do not use the watchdog core but re-implement its
functionality. RTC_DRV_M41T80_WDT was written before the watchdog
core existed, so this is understandable. You would have to ask the
author of RTC_DRV_DS1374_WDT support why it doesn't use the
watchdog core but re-implements it.

> DS1374 and M41T80 does not seem to check on any other
> WATCHDOG defines other then their _WDT Kconfig.
> 
> I can create a patch that hides the watchdog code if WATCHDOG
> define is not set, if that's the right way?
> 

That is for you and the rtc maintainer to decide.

Guenter

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

* Re: [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE
  2019-08-23 14:05 ` Alexandre Belloni
  2019-08-26  8:12   ` Yuehaibing
@ 2019-08-28 17:18   ` Randy Dunlap
  2019-08-29 14:04     ` Bruno Thomsen
  1 sibling, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2019-08-28 17:18 UTC (permalink / raw)
  To: Alexandre Belloni, YueHaibing
  Cc: a.zummo, bruno.thomsen, linux, linux-rtc, linux-kernel

On 8/23/19 7:05 AM, Alexandre Belloni wrote:
> On 23/08/2019 20:45:53+0800, YueHaibing wrote:
>> If WATCHDOG_CORE is not set, build fails:
>>
>> drivers/rtc/rtc-pcf2127.o: In function `pcf2127_probe.isra.6':
>> drivers/rtc/rtc-pcf2127.c:478: undefined reference to `devm_watchdog_register_device'
>>
>> Add WATCHDOG_CORE Kconfig dependency to fix this.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Fixes: bbc597561ce1 ("rtc: pcf2127: add watchdog feature support")
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  drivers/rtc/Kconfig | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
>> index 25af63d..9dce7dc 100644
>> --- a/drivers/rtc/Kconfig
>> +++ b/drivers/rtc/Kconfig
>> @@ -886,6 +886,8 @@ config RTC_DRV_DS3232_HWMON
>>  config RTC_DRV_PCF2127
>>  	tristate "NXP PCF2127"
>>  	depends on RTC_I2C_AND_SPI
>> +	depends on WATCHDOG
> 
> Definitively not, I fixed it that way:
> +       select WATCHDOG_CORE if WATCHDOG
> 
> 

No, that's not a fix.  The build error still happens with that patch applied.

-- 
~Randy

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

* Re: [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE
  2019-08-28 17:18   ` Randy Dunlap
@ 2019-08-29 14:04     ` Bruno Thomsen
  0 siblings, 0 replies; 9+ messages in thread
From: Bruno Thomsen @ 2019-08-29 14:04 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Alexandre Belloni, YueHaibing, a.zummo, Guenter Roeck, linux-rtc,
	linux-kernel

Den ons. 28. aug. 2019 kl. 19.19 skrev Randy Dunlap <rdunlap@infradead.org>:
> > Definitively not, I fixed it that way:
> > +       select WATCHDOG_CORE if WATCHDOG
> >
>
> No, that's not a fix.  The build error still happens with that patch applied.

Hi Randy,

A bugfix has been created[1] and applied to the rtc tree.

Bruno

[1] https://lkml.org/lkml/2019/8/27/1018

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

end of thread, other threads:[~2019-08-29 14:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23 12:45 [PATCH -next] rtc: pcf2127: Fix build error without CONFIG_WATCHDOG_CORE YueHaibing
2019-08-23 13:38 ` Guenter Roeck
2019-08-23 14:05 ` Alexandre Belloni
2019-08-26  8:12   ` Yuehaibing
2019-08-26 13:20     ` Guenter Roeck
2019-08-26 18:13       ` Bruno Thomsen
2019-08-26 18:46         ` Guenter Roeck
2019-08-28 17:18   ` Randy Dunlap
2019-08-29 14:04     ` Bruno Thomsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).