diff mbox series

[2/2] iio: dac: Fix dependencies of AD9739A

Message ID 20240616012511.198243-2-alexey.makhalov@broadcom.com (mailing list archive)
State Handled Elsewhere
Headers show
Series [1/2] drm/vmwgfx: Fix missing HYPERVISOR_GUEST dependency | expand

Commit Message

Alexey Makhalov June 16, 2024, 1:25 a.m. UTC
0-DAY CI Kernel Test automation reported an issue:

   ld: drivers/base/regmap/regmap-spi.o: in function `regmap_spi_read':
   regmap-spi.c:(.text+0xf): undefined reference to `spi_write_then_read'
   ld: drivers/base/regmap/regmap-spi.o: in function `regmap_spi_gather_write':
   regmap-spi.c:(.text+0x2b4): undefined reference to `spi_sync'
   ld: drivers/base/regmap/regmap-spi.o: in function `spi_sync_transfer.constprop.0':
   regmap-spi.c:(.text+0x337): undefined reference to `spi_sync'
   ld: drivers/base/regmap/regmap-spi.o: in function `regmap_spi_async_write':
   regmap-spi.c:(.text+0x445): undefined reference to `spi_async'
   ld: drivers/iio/dac/ad9739a.o: in function `ad9739a_driver_init':
   ad9739a.c:(.init.text+0x10): undefined reference to `__spi_register_driver'

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for REGMAP_SPI
   Depends on [n]: SPI [=n]
   Selected by [y]:
   - AD9739A [=y] && IIO [=y] && (SPI [=n] || COMPILE_TEST [=y])

The issue is caused by CONFIG_AD9739A=y when CONFIG_SPI is not set.

Add explicit dependency on SPI and conditional selection of REGMAP_SPI.

Fixes: e77603d5468b ("iio: dac: support the ad9739a RF DAC")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406152104.FxakP1MB-lkp@intel.com/
Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
---
 drivers/iio/dac/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Borislav Petkov June 17, 2024, 9:04 a.m. UTC | #1
On Sat, Jun 15, 2024 at 06:25:11PM -0700, Alexey Makhalov wrote:
> 0-DAY CI Kernel Test automation reported an issue:
> 
>    ld: drivers/base/regmap/regmap-spi.o: in function `regmap_spi_read':
>    regmap-spi.c:(.text+0xf): undefined reference to `spi_write_then_read'
>    ld: drivers/base/regmap/regmap-spi.o: in function `regmap_spi_gather_write':
>    regmap-spi.c:(.text+0x2b4): undefined reference to `spi_sync'
>    ld: drivers/base/regmap/regmap-spi.o: in function `spi_sync_transfer.constprop.0':
>    regmap-spi.c:(.text+0x337): undefined reference to `spi_sync'
>    ld: drivers/base/regmap/regmap-spi.o: in function `regmap_spi_async_write':
>    regmap-spi.c:(.text+0x445): undefined reference to `spi_async'
>    ld: drivers/iio/dac/ad9739a.o: in function `ad9739a_driver_init':
>    ad9739a.c:(.init.text+0x10): undefined reference to `__spi_register_driver'
> 
> Kconfig warnings: (for reference only)
>    WARNING: unmet direct dependencies detected for REGMAP_SPI
>    Depends on [n]: SPI [=n]
>    Selected by [y]:
>    - AD9739A [=y] && IIO [=y] && (SPI [=n] || COMPILE_TEST [=y])
> 
> The issue is caused by CONFIG_AD9739A=y when CONFIG_SPI is not set.
> 
> Add explicit dependency on SPI and conditional selection of REGMAP_SPI.
> 
> Fixes: e77603d5468b ("iio: dac: support the ad9739a RF DAC")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202406152104.FxakP1MB-lkp@intel.com/
> Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
> ---
>  drivers/iio/dac/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
> index 3c2bf620f00f..d095f4d26e49 100644
> --- a/drivers/iio/dac/Kconfig
> +++ b/drivers/iio/dac/Kconfig
> @@ -133,8 +133,8 @@ config AD5624R_SPI
>  
>  config AD9739A
>  	tristate "Analog Devices AD9739A RF DAC spi driver"
> -	depends on SPI || COMPILE_TEST
> -	select REGMAP_SPI
> +	depends on SPI
> +	select REGMAP_SPI if SPI_MASTER
>  	select IIO_BACKEND
>  	help
>  	  Say yes here to build support for Analog Devices AD9739A Digital-to
> -- 

FWIW, I appreciate it you fixing other breakages. However, there's a patch for
that already, on its way:

https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=fixes-togreg&id=75183e461ce033605c3e85518a9f3d4e4ef848a3

Don't get discouraged, though, when fixing something that is not in our
immediate area of interest!

:-)

Thx.
Alexey Makhalov June 17, 2024, 8:48 p.m. UTC | #2
On 6/17/24 2:04 AM, Borislav Petkov wrote:
> On Sat, Jun 15, 2024 at 06:25:11PM -0700, Alexey Makhalov wrote:
>> 0-DAY CI Kernel Test automation reported an issue:
>>
>>     ld: drivers/base/regmap/regmap-spi.o: in function `regmap_spi_read':
>>     regmap-spi.c:(.text+0xf): undefined reference to `spi_write_then_read'
>>     ld: drivers/base/regmap/regmap-spi.o: in function `regmap_spi_gather_write':
>>     regmap-spi.c:(.text+0x2b4): undefined reference to `spi_sync'
>>     ld: drivers/base/regmap/regmap-spi.o: in function `spi_sync_transfer.constprop.0':
>>     regmap-spi.c:(.text+0x337): undefined reference to `spi_sync'
>>     ld: drivers/base/regmap/regmap-spi.o: in function `regmap_spi_async_write':
>>     regmap-spi.c:(.text+0x445): undefined reference to `spi_async'
>>     ld: drivers/iio/dac/ad9739a.o: in function `ad9739a_driver_init':
>>     ad9739a.c:(.init.text+0x10): undefined reference to `__spi_register_driver'
>>
>> Kconfig warnings: (for reference only)
>>     WARNING: unmet direct dependencies detected for REGMAP_SPI
>>     Depends on [n]: SPI [=n]
>>     Selected by [y]:
>>     - AD9739A [=y] && IIO [=y] && (SPI [=n] || COMPILE_TEST [=y])
>>
>> The issue is caused by CONFIG_AD9739A=y when CONFIG_SPI is not set.
>>
>> Add explicit dependency on SPI and conditional selection of REGMAP_SPI.
>>
>> Fixes: e77603d5468b ("iio: dac: support the ad9739a RF DAC")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202406152104.FxakP1MB-lkp@intel.com/
>> Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
>> ---
>>   drivers/iio/dac/Kconfig | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
>> index 3c2bf620f00f..d095f4d26e49 100644
>> --- a/drivers/iio/dac/Kconfig
>> +++ b/drivers/iio/dac/Kconfig
>> @@ -133,8 +133,8 @@ config AD5624R_SPI
>>   
>>   config AD9739A
>>   	tristate "Analog Devices AD9739A RF DAC spi driver"
>> -	depends on SPI || COMPILE_TEST
>> -	select REGMAP_SPI
>> +	depends on SPI
>> +	select REGMAP_SPI if SPI_MASTER
>>   	select IIO_BACKEND
>>   	help
>>   	  Say yes here to build support for Analog Devices AD9739A Digital-to
>> -- 
> 
> FWIW, I appreciate it you fixing other breakages. However, there's a patch for
> that already, on its way:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=fixes-togreg&id=75183e461ce033605c3e85518a9f3d4e4ef848a3
> 
> Don't get discouraged, though, when fixing something that is not in our
> immediate area of interest!
> 
> :-)
> 
> Thx.
> 

Lesson learned and noted for next time to address only related/new 
warnings and errors. Thanks!
Borislav Petkov June 17, 2024, 9:02 p.m. UTC | #3
On Mon, Jun 17, 2024 at 01:48:38PM -0700, Alexey Makhalov wrote:
> > Don't get discouraged, though, when fixing something that is not in our
> > immediate area of interest!
> > 
> > :-)
>
> Lesson learned and noted for next time to address only related/new warnings
> and errors. Thanks!

I actually meant the exact opposite. :-)
diff mbox series

Patch

diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
index 3c2bf620f00f..d095f4d26e49 100644
--- a/drivers/iio/dac/Kconfig
+++ b/drivers/iio/dac/Kconfig
@@ -133,8 +133,8 @@  config AD5624R_SPI
 
 config AD9739A
 	tristate "Analog Devices AD9739A RF DAC spi driver"
-	depends on SPI || COMPILE_TEST
-	select REGMAP_SPI
+	depends on SPI
+	select REGMAP_SPI if SPI_MASTER
 	select IIO_BACKEND
 	help
 	  Say yes here to build support for Analog Devices AD9739A Digital-to