linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio/adc: ingenic: fix (MIPS) ingenic-adc build errors
@ 2021-11-06 17:49 Randy Dunlap
  2021-11-09 12:05 ` Paul Cercueil
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2021-11-06 17:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, kernel test robot, Artur Rojek, Paul Cercueil,
	linux-mips, Jonathan Cameron, Lars-Peter Clausen, linux-iio,
	Florian Fainelli, Andy Shevchenko

MIPS does not always provide clk*() interfaces and there are no
always-present stubs for them, so depending on "MIPS || COMPILE_TEST"
is not strong enough to prevent build errors.

Likewise MACH_INGENIC_SOC || COMPILE_TEST is not strong enough
since if only COMPILE_TEST=y (with some other MIPS MACH_ or CPU or
BOARD setting), there are still the same build errors.

It looks like depending on MACH_INGENIC_SOC is the only thing that is
sufficient here in order to prevent build errors.

mips-linux-ld: drivers/iio/adc/ingenic-adc.o: in function `jz4770_adc_init_clk_div':
ingenic-adc.c:(.text+0xe4): undefined reference to `clk_get_parent'
mips-linux-ld: drivers/iio/adc/ingenic-adc.o: in function `jz4725b_adc_init_clk_div':
ingenic-adc.c:(.text+0x1b8): undefined reference to `clk_get_parent'

Fixes: 1a78daea107d ("IIO: add Ingenic JZ47xx ADC driver.")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Artur Rojek <contact@artur-rojek.eu>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: linux-mips@vger.kernel.org
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-iio@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/iio/adc/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20211105.orig/drivers/iio/adc/Kconfig
+++ linux-next-20211105/drivers/iio/adc/Kconfig
@@ -501,7 +501,7 @@ config INA2XX_ADC
 
 config INGENIC_ADC
 	tristate "Ingenic JZ47xx SoCs ADC driver"
-	depends on MIPS || COMPILE_TEST
+	depends on MACH_INGENIC_SOC
 	select IIO_BUFFER
 	help
 	  Say yes here to build support for the Ingenic JZ47xx SoCs ADC unit.

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

* Re: [PATCH] iio/adc: ingenic: fix (MIPS) ingenic-adc build errors
  2021-11-06 17:49 [PATCH] iio/adc: ingenic: fix (MIPS) ingenic-adc build errors Randy Dunlap
@ 2021-11-09 12:05 ` Paul Cercueil
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Cercueil @ 2021-11-09 12:05 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, kernel test robot, Artur Rojek, linux-mips,
	Jonathan Cameron, Lars-Peter Clausen, linux-iio,
	Florian Fainelli, Andy Shevchenko

Hi Randy,

Le sam., nov. 6 2021 at 10:49:32 -0700, Randy Dunlap 
<rdunlap@infradead.org> a écrit :
> MIPS does not always provide clk*() interfaces and there are no
> always-present stubs for them, so depending on "MIPS || COMPILE_TEST"
> is not strong enough to prevent build errors.
> 
> Likewise MACH_INGENIC_SOC || COMPILE_TEST is not strong enough
> since if only COMPILE_TEST=y (with some other MIPS MACH_ or CPU or
> BOARD setting), there are still the same build errors.
> 
> It looks like depending on MACH_INGENIC_SOC is the only thing that is
> sufficient here in order to prevent build errors.

Should be "depends on MACH_INGENIC". This symbol is selected when 
building a kernel tailored for Ingenic boards (CONFIG_MACH_INGENIC_SOC) 
and also selected when building a generic MIPS kernel that supports 
Ingenic SoCs (CONFIG_BOARD_INGENIC).

Cheers,
-Paul

> 
> mips-linux-ld: drivers/iio/adc/ingenic-adc.o: in function 
> `jz4770_adc_init_clk_div':
> ingenic-adc.c:(.text+0xe4): undefined reference to `clk_get_parent'
> mips-linux-ld: drivers/iio/adc/ingenic-adc.o: in function 
> `jz4725b_adc_init_clk_div':
> ingenic-adc.c:(.text+0x1b8): undefined reference to `clk_get_parent'
> 
> Fixes: 1a78daea107d ("IIO: add Ingenic JZ47xx ADC driver.")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Artur Rojek <contact@artur-rojek.eu>
> Cc: Paul Cercueil <paul@crapouillou.net>
> Cc: linux-mips@vger.kernel.org
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Lars-Peter Clausen <lars@metafoo.de>
> Cc: linux-iio@vger.kernel.org
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> ---
>  drivers/iio/adc/Kconfig |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-next-20211105.orig/drivers/iio/adc/Kconfig
> +++ linux-next-20211105/drivers/iio/adc/Kconfig
> @@ -501,7 +501,7 @@ config INA2XX_ADC
> 
>  config INGENIC_ADC
>  	tristate "Ingenic JZ47xx SoCs ADC driver"
> -	depends on MIPS || COMPILE_TEST
> +	depends on MACH_INGENIC_SOC
>  	select IIO_BUFFER
>  	help
>  	  Say yes here to build support for the Ingenic JZ47xx SoCs ADC 
> unit.



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

end of thread, other threads:[~2021-11-09 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06 17:49 [PATCH] iio/adc: ingenic: fix (MIPS) ingenic-adc build errors Randy Dunlap
2021-11-09 12:05 ` Paul Cercueil

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).