All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: atomisp: add I2C dependency
@ 2023-02-02 21:02 Arnd Bergmann
  2023-02-02 21:34 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2023-02-02 21:02 UTC (permalink / raw)
  To: Hans de Goede, Mauro Carvalho Chehab
  Cc: Arnd Bergmann, Sakari Ailus, Greg Kroah-Hartman, linux-media,
	linux-staging, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Without CONFIG_I2C, atomisp fails to build because of a missing
function declaration:

drivers/staging/media/atomisp/pci/atomisp_v4l2.c: In function 'atomisp_subdev_probe':
drivers/staging/media/atomisp/pci/atomisp_v4l2.c:960:21: error: implicit declaration of function 'i2c_get_adapter'; did you mean 'i2c_get_adapdata'? [-Werror=implicit-function-declaration]
  960 |                     i2c_get_adapter(subdevs->v4l2_subdev.i2c_adapter_id);
      |                     ^~~~~~~~~~~~~~~
      |                     i2c_get_adapdata

Ideally the driver should just move away from calling i2c_get_adapter
as explained in a comment near the call. For now, just use a Kconfig
dependency. Apparently configurations with I2C disabled are rare in
practice as well as in randconfig builds because a lot of other
drivers 'select' the subsystem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/media/atomisp/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/atomisp/Kconfig b/drivers/staging/media/atomisp/Kconfig
index c9bff98e5309..8b0de0b5b4a3 100644
--- a/drivers/staging/media/atomisp/Kconfig
+++ b/drivers/staging/media/atomisp/Kconfig
@@ -13,6 +13,7 @@ config VIDEO_ATOMISP
 	tristate "Intel Atom Image Signal Processor Driver"
 	depends on VIDEO_DEV && INTEL_ATOMISP
 	depends on PMIC_OPREGION
+	depends on I2C
 	select IOSF_MBI
 	select VIDEOBUF2_VMALLOC
 	select VIDEO_V4L2_SUBDEV_API
-- 
2.39.0


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

* Re: [PATCH] media: atomisp: add I2C dependency
  2023-02-02 21:02 [PATCH] media: atomisp: add I2C dependency Arnd Bergmann
@ 2023-02-02 21:34 ` Hans de Goede
  2023-02-02 21:40   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2023-02-02 21:34 UTC (permalink / raw)
  To: Arnd Bergmann, Mauro Carvalho Chehab
  Cc: Arnd Bergmann, Sakari Ailus, Greg Kroah-Hartman, linux-media,
	linux-staging, linux-kernel

Hi Arnd,

On 2/2/23 22:02, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Without CONFIG_I2C, atomisp fails to build because of a missing
> function declaration:
> 
> drivers/staging/media/atomisp/pci/atomisp_v4l2.c: In function 'atomisp_subdev_probe':
> drivers/staging/media/atomisp/pci/atomisp_v4l2.c:960:21: error: implicit declaration of function 'i2c_get_adapter'; did you mean 'i2c_get_adapdata'? [-Werror=implicit-function-declaration]
>   960 |                     i2c_get_adapter(subdevs->v4l2_subdev.i2c_adapter_id);
>       |                     ^~~~~~~~~~~~~~~
>       |                     i2c_get_adapdata
> 
> Ideally the driver should just move away from calling i2c_get_adapter
> as explained in a comment near the call. For now, just use a Kconfig
> dependency. Apparently configurations with I2C disabled are rare in
> practice as well as in randconfig builds because a lot of other
> drivers 'select' the subsystem.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Actually the i2c_get_adapter() call is gone in the atomisp pull-req
which I send to Mauro for 6.3, it is removed by this patch.

https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/commit/?h=media-atomisp-6.3-1&id=4f205ce7a915ffa4ae0fb24f48714604d39baa29

So adding the I2C dependency is no longer necessary.

Regards,

Hans






> ---
>  drivers/staging/media/atomisp/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/media/atomisp/Kconfig b/drivers/staging/media/atomisp/Kconfig
> index c9bff98e5309..8b0de0b5b4a3 100644
> --- a/drivers/staging/media/atomisp/Kconfig
> +++ b/drivers/staging/media/atomisp/Kconfig
> @@ -13,6 +13,7 @@ config VIDEO_ATOMISP
>  	tristate "Intel Atom Image Signal Processor Driver"
>  	depends on VIDEO_DEV && INTEL_ATOMISP
>  	depends on PMIC_OPREGION
> +	depends on I2C
>  	select IOSF_MBI
>  	select VIDEOBUF2_VMALLOC
>  	select VIDEO_V4L2_SUBDEV_API


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

* Re: [PATCH] media: atomisp: add I2C dependency
  2023-02-02 21:34 ` Hans de Goede
@ 2023-02-02 21:40   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2023-02-02 21:40 UTC (permalink / raw)
  To: Hans de Goede, Arnd Bergmann, Mauro Carvalho Chehab
  Cc: Sakari Ailus, Greg Kroah-Hartman, linux-media, linux-staging,
	linux-kernel

On Thu, Feb 2, 2023, at 22:34, Hans de Goede wrote:
> On 2/2/23 22:02, Arnd Bergmann wrote:
>
> Actually the i2c_get_adapter() call is gone in the atomisp pull-req
> which I send to Mauro for 6.3, it is removed by this patch.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/commit/?h=media-atomisp-6.3-1&id=4f205ce7a915ffa4ae0fb24f48714604d39baa29
>
> So adding the I2C dependency is no longer necessary.

Ok, nice timing then, I must have done thousands of randconfig builds
with atomisp enabled without ever hitting it until today ;-)

     Arnd

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

end of thread, other threads:[~2023-02-02 21:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02 21:02 [PATCH] media: atomisp: add I2C dependency Arnd Bergmann
2023-02-02 21:34 ` Hans de Goede
2023-02-02 21:40   ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.