All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] [media] pwc: hide unused label
@ 2016-01-26 14:09 ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:09 UTC (permalink / raw)
  To: Hans de Goede, Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Arnd Bergmann, Hans Verkuil, linux-media, linux-kernel

The pwc driver causes a warning when CONFIG_USB_PWC_INPUT_EVDEV is unset:

drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe':
drivers/media/usb/pwc/pwc-if.c:1115:1: warning: label 'err_video_unreg' defined but not used [-Wunused-label]

Obviously, the cleanup of &pdev->vdev is not needed without the input device,
so we can just move it inside of the existing #ifdef and remove the
extra label.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/usb/pwc/pwc-if.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
index 086cf1c7bd7d..bdd416af84c7 100644
--- a/drivers/media/usb/pwc/pwc-if.c
+++ b/drivers/media/usb/pwc/pwc-if.c
@@ -1106,14 +1106,13 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 	if (rc) {
 		input_free_device(pdev->button_dev);
 		pdev->button_dev = NULL;
-		goto err_video_unreg;
+		video_unregister_device(&pdev->vdev);
+		goto err_unregister_v4l2_dev;
 	}
 #endif
 
 	return 0;
 
-err_video_unreg:
-	video_unregister_device(&pdev->vdev);
 err_unregister_v4l2_dev:
 	v4l2_device_unregister(&pdev->v4l2_dev);
 err_free_controls:
-- 
2.7.0

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

* [PATCH 1/7] [media] pwc: hide unused label
@ 2016-01-26 14:09 ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:09 UTC (permalink / raw)
  To: linux-arm-kernel

The pwc driver causes a warning when CONFIG_USB_PWC_INPUT_EVDEV is unset:

drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe':
drivers/media/usb/pwc/pwc-if.c:1115:1: warning: label 'err_video_unreg' defined but not used [-Wunused-label]

Obviously, the cleanup of &pdev->vdev is not needed without the input device,
so we can just move it inside of the existing #ifdef and remove the
extra label.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/usb/pwc/pwc-if.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
index 086cf1c7bd7d..bdd416af84c7 100644
--- a/drivers/media/usb/pwc/pwc-if.c
+++ b/drivers/media/usb/pwc/pwc-if.c
@@ -1106,14 +1106,13 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 	if (rc) {
 		input_free_device(pdev->button_dev);
 		pdev->button_dev = NULL;
-		goto err_video_unreg;
+		video_unregister_device(&pdev->vdev);
+		goto err_unregister_v4l2_dev;
 	}
 #endif
 
 	return 0;
 
-err_video_unreg:
-	video_unregister_device(&pdev->vdev);
 err_unregister_v4l2_dev:
 	v4l2_device_unregister(&pdev->v4l2_dev);
 err_free_controls:
-- 
2.7.0

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

* [PATCH 2/7] [media] hdpvr: hide unused variable
  2016-01-26 14:09 ` Arnd Bergmann
@ 2016-01-26 14:09   ` Arnd Bergmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:09 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Arnd Bergmann, Hans Verkuil, linux-media, linux-kernel

The i2c client pointer is only used when CONFIG_I2C is set, and
otherwise produces a compile-time warning:

drivers/media/usb/hdpvr/hdpvr-core.c: In function 'hdpvr_probe':
drivers/media/usb/hdpvr/hdpvr-core.c:276:21: error: unused variable 'client' [-Werror=unused-variable]

This uses the same #ifdef to hide the variable when the code using
it is hidden.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/usb/hdpvr/hdpvr-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
index 3fc64197b4e6..08f0ca7aa012 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -273,7 +273,9 @@ static int hdpvr_probe(struct usb_interface *interface,
 	struct hdpvr_device *dev;
 	struct usb_host_interface *iface_desc;
 	struct usb_endpoint_descriptor *endpoint;
+#if IS_ENABLED(CONFIG_I2C)
 	struct i2c_client *client;
+#endif
 	size_t buffer_size;
 	int i;
 	int retval = -ENOMEM;
-- 
2.7.0

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

* [PATCH 2/7] [media] hdpvr: hide unused variable
@ 2016-01-26 14:09   ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:09 UTC (permalink / raw)
  To: linux-arm-kernel

The i2c client pointer is only used when CONFIG_I2C is set, and
otherwise produces a compile-time warning:

drivers/media/usb/hdpvr/hdpvr-core.c: In function 'hdpvr_probe':
drivers/media/usb/hdpvr/hdpvr-core.c:276:21: error: unused variable 'client' [-Werror=unused-variable]

This uses the same #ifdef to hide the variable when the code using
it is hidden.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/usb/hdpvr/hdpvr-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
index 3fc64197b4e6..08f0ca7aa012 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -273,7 +273,9 @@ static int hdpvr_probe(struct usb_interface *interface,
 	struct hdpvr_device *dev;
 	struct usb_host_interface *iface_desc;
 	struct usb_endpoint_descriptor *endpoint;
+#if IS_ENABLED(CONFIG_I2C)
 	struct i2c_client *client;
+#endif
 	size_t buffer_size;
 	int i;
 	int retval = -ENOMEM;
-- 
2.7.0

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

* [PATCH 3/7] [media] gspca: avoid unused variable warnings
  2016-01-26 14:09 ` Arnd Bergmann
@ 2016-01-26 14:09   ` Arnd Bergmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:09 UTC (permalink / raw)
  To: Hans de Goede, Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Arnd Bergmann, Hans Verkuil,
	Leandro Costantino, linux-media, linux-kernel

When CONFIG_INPUT is disabled, multiple gspca backend drivers
print compile-time warnings about unused variables:

media/usb/gspca/cpia1.c: In function 'sd_stopN':
media/usb/gspca/cpia1.c:1627:13: error: unused variable 'sd' [-Werror=unused-variable]
media/usb/gspca/konica.c: In function 'sd_stopN':
media/usb/gspca/konica.c:246:13: error: unused variable 'sd' [-Werror=unused-variable]

This encloses the declarations in #ifdef CONFIG_INPUT, just like
the code using them is.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: ee186fd96a5f ("[media] gscpa_t613: Add support for the camera button")
Fixes: c2f644aeeba3 ("[media] gspca_cpia1: Add support for button")
Fixes: b517af722860 ("V4L/DVB: gspca_konica: New gspca subdriver for konica chipset using cams")
---
 drivers/media/usb/gspca/cpia1.c  | 2 ++
 drivers/media/usb/gspca/konica.c | 2 ++
 drivers/media/usb/gspca/t613.c   | 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c
index f23df4a9d8c5..e2264dc5d64d 100644
--- a/drivers/media/usb/gspca/cpia1.c
+++ b/drivers/media/usb/gspca/cpia1.c
@@ -1624,7 +1624,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
 
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
+#if IS_ENABLED(CONFIG_INPUT)
 	struct sd *sd = (struct sd *) gspca_dev;
+#endif
 
 	command_pause(gspca_dev);
 
diff --git a/drivers/media/usb/gspca/konica.c b/drivers/media/usb/gspca/konica.c
index 39c96bb4c985..21c52655ef28 100644
--- a/drivers/media/usb/gspca/konica.c
+++ b/drivers/media/usb/gspca/konica.c
@@ -243,7 +243,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
 
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
+#if IS_ENABLED(CONFIG_INPUT)
 	struct sd *sd = (struct sd *) gspca_dev;
+#endif
 
 	konica_stream_off(gspca_dev);
 #if IS_ENABLED(CONFIG_INPUT)
diff --git a/drivers/media/usb/gspca/t613.c b/drivers/media/usb/gspca/t613.c
index e2cc4e5a0ccb..d918c2d31502 100644
--- a/drivers/media/usb/gspca/t613.c
+++ b/drivers/media/usb/gspca/t613.c
@@ -837,11 +837,12 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
 			u8 *data,			/* isoc packet */
 			int len)			/* iso packet length */
 {
-	struct sd *sd = (struct sd *) gspca_dev;
 	int pkt_type;
 
 	if (data[0] == 0x5a) {
 #if IS_ENABLED(CONFIG_INPUT)
+		struct sd *sd = (struct sd *) gspca_dev;
+
 		if (len > 20) {
 			u8 state = (data[20] & 0x80) ? 1 : 0;
 			if (sd->button_pressed != state) {
-- 
2.7.0

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

* [PATCH 3/7] [media] gspca: avoid unused variable warnings
@ 2016-01-26 14:09   ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:09 UTC (permalink / raw)
  To: linux-arm-kernel

When CONFIG_INPUT is disabled, multiple gspca backend drivers
print compile-time warnings about unused variables:

media/usb/gspca/cpia1.c: In function 'sd_stopN':
media/usb/gspca/cpia1.c:1627:13: error: unused variable 'sd' [-Werror=unused-variable]
media/usb/gspca/konica.c: In function 'sd_stopN':
media/usb/gspca/konica.c:246:13: error: unused variable 'sd' [-Werror=unused-variable]

This encloses the declarations in #ifdef CONFIG_INPUT, just like
the code using them is.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: ee186fd96a5f ("[media] gscpa_t613: Add support for the camera button")
Fixes: c2f644aeeba3 ("[media] gspca_cpia1: Add support for button")
Fixes: b517af722860 ("V4L/DVB: gspca_konica: New gspca subdriver for konica chipset using cams")
---
 drivers/media/usb/gspca/cpia1.c  | 2 ++
 drivers/media/usb/gspca/konica.c | 2 ++
 drivers/media/usb/gspca/t613.c   | 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c
index f23df4a9d8c5..e2264dc5d64d 100644
--- a/drivers/media/usb/gspca/cpia1.c
+++ b/drivers/media/usb/gspca/cpia1.c
@@ -1624,7 +1624,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
 
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
+#if IS_ENABLED(CONFIG_INPUT)
 	struct sd *sd = (struct sd *) gspca_dev;
+#endif
 
 	command_pause(gspca_dev);
 
diff --git a/drivers/media/usb/gspca/konica.c b/drivers/media/usb/gspca/konica.c
index 39c96bb4c985..21c52655ef28 100644
--- a/drivers/media/usb/gspca/konica.c
+++ b/drivers/media/usb/gspca/konica.c
@@ -243,7 +243,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
 
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
+#if IS_ENABLED(CONFIG_INPUT)
 	struct sd *sd = (struct sd *) gspca_dev;
+#endif
 
 	konica_stream_off(gspca_dev);
 #if IS_ENABLED(CONFIG_INPUT)
diff --git a/drivers/media/usb/gspca/t613.c b/drivers/media/usb/gspca/t613.c
index e2cc4e5a0ccb..d918c2d31502 100644
--- a/drivers/media/usb/gspca/t613.c
+++ b/drivers/media/usb/gspca/t613.c
@@ -837,11 +837,12 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
 			u8 *data,			/* isoc packet */
 			int len)			/* iso packet length */
 {
-	struct sd *sd = (struct sd *) gspca_dev;
 	int pkt_type;
 
 	if (data[0] == 0x5a) {
 #if IS_ENABLED(CONFIG_INPUT)
+		struct sd *sd = (struct sd *) gspca_dev;
+
 		if (len > 20) {
 			u8 state = (data[20] & 0x80) ? 1 : 0;
 			if (sd->button_pressed != state) {
-- 
2.7.0

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

* [PATCH 4/7] [media] b2c2: flexcop: avoid unused function warnings
  2016-01-26 14:09 ` Arnd Bergmann
@ 2016-01-26 14:09   ` Arnd Bergmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:09 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Arnd Bergmann, Hans Verkuil, Jemma Denson,
	linux-media, linux-kernel

The flexcop driver has two functions that are normally used, except
when multiple frontend drivers are disabled:

drivers/media/common/b2c2/flexcop-fe-tuner.c:42:12: warning: 'flexcop_set_voltage' defined but not used [-Wunused-function]
drivers/media/common/b2c2/flexcop-fe-tuner.c:71:12: warning: 'flexcop_sleep' defined but not used [-Wunused-function]

This avoids the build warning by updating the #ifdef for flexcop_set_voltage
to the exact condition under which it is used. For flexcop_sleep, the
condition is rather complex, so I resort to marking it as __maybe_unused,
so the compiler can silently drop it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/common/b2c2/flexcop-fe-tuner.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/common/b2c2/flexcop-fe-tuner.c b/drivers/media/common/b2c2/flexcop-fe-tuner.c
index 9c59f4306883..f5956402fc69 100644
--- a/drivers/media/common/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/common/b2c2/flexcop-fe-tuner.c
@@ -38,7 +38,7 @@ static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
 #endif
 
 /* lnb control */
-#if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)
+#if (FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)) && FE_SUPPORTED(PLL)
 static int flexcop_set_voltage(struct dvb_frontend *fe,
 			       enum fe_sec_voltage voltage)
 {
@@ -68,7 +68,7 @@ static int flexcop_set_voltage(struct dvb_frontend *fe,
 #endif
 
 #if FE_SUPPORTED(S5H1420) || FE_SUPPORTED(STV0299) || FE_SUPPORTED(MT312)
-static int flexcop_sleep(struct dvb_frontend* fe)
+static int __maybe_unused flexcop_sleep(struct dvb_frontend* fe)
 {
 	struct flexcop_device *fc = fe->dvb->priv;
 	if (fc->fe_sleep)
-- 
2.7.0

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

* [PATCH 4/7] [media] b2c2: flexcop: avoid unused function warnings
@ 2016-01-26 14:09   ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:09 UTC (permalink / raw)
  To: linux-arm-kernel

The flexcop driver has two functions that are normally used, except
when multiple frontend drivers are disabled:

drivers/media/common/b2c2/flexcop-fe-tuner.c:42:12: warning: 'flexcop_set_voltage' defined but not used [-Wunused-function]
drivers/media/common/b2c2/flexcop-fe-tuner.c:71:12: warning: 'flexcop_sleep' defined but not used [-Wunused-function]

This avoids the build warning by updating the #ifdef for flexcop_set_voltage
to the exact condition under which it is used. For flexcop_sleep, the
condition is rather complex, so I resort to marking it as __maybe_unused,
so the compiler can silently drop it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/common/b2c2/flexcop-fe-tuner.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/common/b2c2/flexcop-fe-tuner.c b/drivers/media/common/b2c2/flexcop-fe-tuner.c
index 9c59f4306883..f5956402fc69 100644
--- a/drivers/media/common/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/common/b2c2/flexcop-fe-tuner.c
@@ -38,7 +38,7 @@ static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
 #endif
 
 /* lnb control */
-#if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)
+#if (FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)) && FE_SUPPORTED(PLL)
 static int flexcop_set_voltage(struct dvb_frontend *fe,
 			       enum fe_sec_voltage voltage)
 {
@@ -68,7 +68,7 @@ static int flexcop_set_voltage(struct dvb_frontend *fe,
 #endif
 
 #if FE_SUPPORTED(S5H1420) || FE_SUPPORTED(STV0299) || FE_SUPPORTED(MT312)
-static int flexcop_sleep(struct dvb_frontend* fe)
+static int __maybe_unused flexcop_sleep(struct dvb_frontend* fe)
 {
 	struct flexcop_device *fc = fe->dvb->priv;
 	if (fc->fe_sleep)
-- 
2.7.0

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

* [PATCH 5/7] [media] em28xx: only use mt9v011 if camera support is enabled
  2016-01-26 14:09 ` Arnd Bergmann
@ 2016-01-26 14:09   ` Arnd Bergmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:09 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Arnd Bergmann, Hans Verkuil, linux-media, linux-kernel

In randconfig builds that select VIDEO_EM28XX_V4L2 and
MEDIA_SUBDRV_AUTOSELECT, but not MEDIA_CAMERA_SUPPORT, we get
a Kconfig warning:

 warning: (VIDEO_EM28XX_V4L2) selects VIDEO_MT9V011 which has unmet direct dependencies (MEDIA_SUPPORT && I2C && VIDEO_V4L2 && MEDIA_CAMERA_SUPPORT)

This avoids the warning by making that 'select' conditional on
MEDIA_CAMERA_SUPPORT. Alternatively we could mark EM28XX as
'depends on MEDIA_CAMERA_SUPPORT', but it does not seem to
have any real dependency on that itself.

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

diff --git a/drivers/media/usb/em28xx/Kconfig b/drivers/media/usb/em28xx/Kconfig
index e382210c4ada..75323f5efd0f 100644
--- a/drivers/media/usb/em28xx/Kconfig
+++ b/drivers/media/usb/em28xx/Kconfig
@@ -11,7 +11,7 @@ config VIDEO_EM28XX_V4L2
 	select VIDEO_SAA711X if MEDIA_SUBDRV_AUTOSELECT
 	select VIDEO_TVP5150 if MEDIA_SUBDRV_AUTOSELECT
 	select VIDEO_MSP3400 if MEDIA_SUBDRV_AUTOSELECT
-	select VIDEO_MT9V011 if MEDIA_SUBDRV_AUTOSELECT
+	select VIDEO_MT9V011 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
 
 	---help---
 	  This is a video4linux driver for Empia 28xx based TV cards.
-- 
2.7.0

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

* [PATCH 5/7] [media] em28xx: only use mt9v011 if camera support is enabled
@ 2016-01-26 14:09   ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:09 UTC (permalink / raw)
  To: linux-arm-kernel

In randconfig builds that select VIDEO_EM28XX_V4L2 and
MEDIA_SUBDRV_AUTOSELECT, but not MEDIA_CAMERA_SUPPORT, we get
a Kconfig warning:

 warning: (VIDEO_EM28XX_V4L2) selects VIDEO_MT9V011 which has unmet direct dependencies (MEDIA_SUPPORT && I2C && VIDEO_V4L2 && MEDIA_CAMERA_SUPPORT)

This avoids the warning by making that 'select' conditional on
MEDIA_CAMERA_SUPPORT. Alternatively we could mark EM28XX as
'depends on MEDIA_CAMERA_SUPPORT', but it does not seem to
have any real dependency on that itself.

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

diff --git a/drivers/media/usb/em28xx/Kconfig b/drivers/media/usb/em28xx/Kconfig
index e382210c4ada..75323f5efd0f 100644
--- a/drivers/media/usb/em28xx/Kconfig
+++ b/drivers/media/usb/em28xx/Kconfig
@@ -11,7 +11,7 @@ config VIDEO_EM28XX_V4L2
 	select VIDEO_SAA711X if MEDIA_SUBDRV_AUTOSELECT
 	select VIDEO_TVP5150 if MEDIA_SUBDRV_AUTOSELECT
 	select VIDEO_MSP3400 if MEDIA_SUBDRV_AUTOSELECT
-	select VIDEO_MT9V011 if MEDIA_SUBDRV_AUTOSELECT
+	select VIDEO_MT9V011 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
 
 	---help---
 	  This is a video4linux driver for Empia 28xx based TV cards.
-- 
2.7.0

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

* [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
  2016-01-26 14:09 ` Arnd Bergmann
@ 2016-01-26 14:10   ` Arnd Bergmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:10 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Arnd Bergmann, Hans Verkuil, linux-media, linux-kernel

em28xx selects VIDEO_TUNER, which has a dependency on MEDIA_TUNER,
so we get a Kconfig warning if that is disabled:

warning: (VIDEO_PVRUSB2 && VIDEO_USBVISION && VIDEO_GO7007 && VIDEO_AU0828_V4L2 && VIDEO_CX231XX && VIDEO_TM6000 && VIDEO_EM28XX && VIDEO_IVTV && VIDEO_MXB && VIDEO_CX18 && VIDEO_CX23885 && VIDEO_CX88 && VIDEO_BT848 && VIDEO_SAA7134 && VIDEO_SAA7164) selects VIDEO_TUNER which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_TUNER)

This adds a dependency on MEDIA_TUNER to avoid the warning.

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

diff --git a/drivers/media/usb/em28xx/Kconfig b/drivers/media/usb/em28xx/Kconfig
index 75323f5efd0f..cacc757e2254 100644
--- a/drivers/media/usb/em28xx/Kconfig
+++ b/drivers/media/usb/em28xx/Kconfig
@@ -1,6 +1,6 @@
 config VIDEO_EM28XX
 	tristate "Empia EM28xx USB devices support"
-	depends on VIDEO_DEV && I2C
+	depends on VIDEO_DEV && I2C && MEDIA_TUNER
 	select VIDEO_TUNER
 	select VIDEO_TVEEPROM
 
-- 
2.7.0

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

* [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
@ 2016-01-26 14:10   ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

em28xx selects VIDEO_TUNER, which has a dependency on MEDIA_TUNER,
so we get a Kconfig warning if that is disabled:

warning: (VIDEO_PVRUSB2 && VIDEO_USBVISION && VIDEO_GO7007 && VIDEO_AU0828_V4L2 && VIDEO_CX231XX && VIDEO_TM6000 && VIDEO_EM28XX && VIDEO_IVTV && VIDEO_MXB && VIDEO_CX18 && VIDEO_CX23885 && VIDEO_CX88 && VIDEO_BT848 && VIDEO_SAA7134 && VIDEO_SAA7164) selects VIDEO_TUNER which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_TUNER)

This adds a dependency on MEDIA_TUNER to avoid the warning.

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

diff --git a/drivers/media/usb/em28xx/Kconfig b/drivers/media/usb/em28xx/Kconfig
index 75323f5efd0f..cacc757e2254 100644
--- a/drivers/media/usb/em28xx/Kconfig
+++ b/drivers/media/usb/em28xx/Kconfig
@@ -1,6 +1,6 @@
 config VIDEO_EM28XX
 	tristate "Empia EM28xx USB devices support"
-	depends on VIDEO_DEV && I2C
+	depends on VIDEO_DEV && I2C && MEDIA_TUNER
 	select VIDEO_TUNER
 	select VIDEO_TVEEPROM
 
-- 
2.7.0

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

* [PATCH 7/7] [media] go7007: add MEDIA_CAMERA_SUPPORT dependency
  2016-01-26 14:09 ` Arnd Bergmann
@ 2016-01-26 14:10   ` Arnd Bergmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:10 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Arnd Bergmann, linux-media, linux-kernel

If MEDIA_SUBDRV_AUTOSELECT and VIDEO_GO7007 are both set, we
automatically select VIDEO_OV7640, but that depends on MEDIA_CAMERA_SUPPORT,
so we get a Kconfig warning if that is disabled:

warning: (VIDEO_GO7007) selects VIDEO_OV7640 which has unmet direct dependencies (MEDIA_SUPPORT && I2C && VIDEO_V4L2 && MEDIA_CAMERA_SUPPORT)

This adds another dependency so we don't accidentally select
it when it is unavailable.

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

diff --git a/drivers/media/usb/go7007/Kconfig b/drivers/media/usb/go7007/Kconfig
index 95a3af644a92..af1d02430931 100644
--- a/drivers/media/usb/go7007/Kconfig
+++ b/drivers/media/usb/go7007/Kconfig
@@ -11,7 +11,7 @@ config VIDEO_GO7007
 	select VIDEO_TW2804 if MEDIA_SUBDRV_AUTOSELECT
 	select VIDEO_TW9903 if MEDIA_SUBDRV_AUTOSELECT
 	select VIDEO_TW9906 if MEDIA_SUBDRV_AUTOSELECT
-	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT
+	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
 	select VIDEO_UDA1342 if MEDIA_SUBDRV_AUTOSELECT
 	---help---
 	  This is a video4linux driver for the WIS GO7007 MPEG
-- 
2.7.0

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

* [PATCH 7/7] [media] go7007: add MEDIA_CAMERA_SUPPORT dependency
@ 2016-01-26 14:10   ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

If MEDIA_SUBDRV_AUTOSELECT and VIDEO_GO7007 are both set, we
automatically select VIDEO_OV7640, but that depends on MEDIA_CAMERA_SUPPORT,
so we get a Kconfig warning if that is disabled:

warning: (VIDEO_GO7007) selects VIDEO_OV7640 which has unmet direct dependencies (MEDIA_SUPPORT && I2C && VIDEO_V4L2 && MEDIA_CAMERA_SUPPORT)

This adds another dependency so we don't accidentally select
it when it is unavailable.

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

diff --git a/drivers/media/usb/go7007/Kconfig b/drivers/media/usb/go7007/Kconfig
index 95a3af644a92..af1d02430931 100644
--- a/drivers/media/usb/go7007/Kconfig
+++ b/drivers/media/usb/go7007/Kconfig
@@ -11,7 +11,7 @@ config VIDEO_GO7007
 	select VIDEO_TW2804 if MEDIA_SUBDRV_AUTOSELECT
 	select VIDEO_TW9903 if MEDIA_SUBDRV_AUTOSELECT
 	select VIDEO_TW9906 if MEDIA_SUBDRV_AUTOSELECT
-	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT
+	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
 	select VIDEO_UDA1342 if MEDIA_SUBDRV_AUTOSELECT
 	---help---
 	  This is a video4linux driver for the WIS GO7007 MPEG
-- 
2.7.0

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

* Re: [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
  2016-01-26 14:10   ` Arnd Bergmann
@ 2016-01-26 14:33     ` Mauro Carvalho Chehab
  -1 siblings, 0 replies; 36+ messages in thread
From: Mauro Carvalho Chehab @ 2016-01-26 14:33 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arm-kernel, Hans Verkuil, linux-media, linux-kernel

Em Tue, 26 Jan 2016 15:10:00 +0100
Arnd Bergmann <arnd@arndb.de> escreveu:

> em28xx selects VIDEO_TUNER, which has a dependency on MEDIA_TUNER,
> so we get a Kconfig warning if that is disabled:
> 
> warning: (VIDEO_PVRUSB2 && VIDEO_USBVISION && VIDEO_GO7007 && VIDEO_AU0828_V4L2 && VIDEO_CX231XX && VIDEO_TM6000 && VIDEO_EM28XX && VIDEO_IVTV && VIDEO_MXB && VIDEO_CX18 && VIDEO_CX23885 && VIDEO_CX88 && VIDEO_BT848 && VIDEO_SAA7134 && VIDEO_SAA7164) selects VIDEO_TUNER which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_TUNER)

This warning is bogus, as it is OK to select VIDEO_TUNER even if MEDIA_TUNER
is not defined.

See how MEDIA_TUNER is defined:


config MEDIA_TUNER
	tristate
	depends on (MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT) && I2C
	default y
	select MEDIA_TUNER_XC2028 if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_XC4000 if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_MT20XX if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_TDA8290 if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_TEA5761 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
	select MEDIA_TUNER_TEA5767 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
	select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_TDA9887 if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_MC44S803 if MEDIA_SUBDRV_AUTOSELECT

MEDIA_TUNER is just one of the media Kconfig workarounds to its limitation of
not allowing to select a device that has dependencies. It is true if the user
selected either TV or radio media devices. It works together with 
MEDIA_SUBDRV_AUTOSELECT. When both are enabled, it selects all
media tuners. That makes easier for end users to not need to worry about
manually selecting the needed tuners.

Advanced users may, instead, manually select the media tuner that his
hardware needs. In such case, it doesn't matter if MEDIA_TUNER
is enabled or not.

As this is due to a Kconfig limitation, I've no idea how to fix or get
hid of it, but making em28xx dependent of MEDIA_TUNER is wrong.

Also, as this is a Kconfig hidden option, making em28xx dependent of
MEDIA_TUNER would actually disable it, if no other media driver is
compiled.

The problem here is that the em28xx driver is used by several different
types of devices:

- pure webcam devices. Those devices don't have a tuner;
- stream capture devices. Those devices don't have a tuner;
- analog TV devices. For analog TV to work, MEDIA_TUNER is needed. Still,
  most of those devices have Composite and S-VIDEO ports. It is possible
  to use the driver for stream capture on those ports even if MEDIA_TUNER
  is not compiled;
- digital TV devices. Those require either a tuner or a DVB frontend.
- any combination of the above.

Regards,
Mauro

> 
> This adds a dependency on MEDIA_TUNER to avoid the warning.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/media/usb/em28xx/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/em28xx/Kconfig b/drivers/media/usb/em28xx/Kconfig
> index 75323f5efd0f..cacc757e2254 100644
> --- a/drivers/media/usb/em28xx/Kconfig
> +++ b/drivers/media/usb/em28xx/Kconfig
> @@ -1,6 +1,6 @@
>  config VIDEO_EM28XX
>  	tristate "Empia EM28xx USB devices support"
> -	depends on VIDEO_DEV && I2C
> +	depends on VIDEO_DEV && I2C && MEDIA_TUNER
>  	select VIDEO_TUNER
>  	select VIDEO_TVEEPROM
>  

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

* [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
@ 2016-01-26 14:33     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 36+ messages in thread
From: Mauro Carvalho Chehab @ 2016-01-26 14:33 UTC (permalink / raw)
  To: linux-arm-kernel

Em Tue, 26 Jan 2016 15:10:00 +0100
Arnd Bergmann <arnd@arndb.de> escreveu:

> em28xx selects VIDEO_TUNER, which has a dependency on MEDIA_TUNER,
> so we get a Kconfig warning if that is disabled:
> 
> warning: (VIDEO_PVRUSB2 && VIDEO_USBVISION && VIDEO_GO7007 && VIDEO_AU0828_V4L2 && VIDEO_CX231XX && VIDEO_TM6000 && VIDEO_EM28XX && VIDEO_IVTV && VIDEO_MXB && VIDEO_CX18 && VIDEO_CX23885 && VIDEO_CX88 && VIDEO_BT848 && VIDEO_SAA7134 && VIDEO_SAA7164) selects VIDEO_TUNER which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_TUNER)

This warning is bogus, as it is OK to select VIDEO_TUNER even if MEDIA_TUNER
is not defined.

See how MEDIA_TUNER is defined:


config MEDIA_TUNER
	tristate
	depends on (MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT) && I2C
	default y
	select MEDIA_TUNER_XC2028 if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_XC4000 if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_MT20XX if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_TDA8290 if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_TEA5761 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
	select MEDIA_TUNER_TEA5767 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
	select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_TDA9887 if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_TUNER_MC44S803 if MEDIA_SUBDRV_AUTOSELECT

MEDIA_TUNER is just one of the media Kconfig workarounds to its limitation of
not allowing to select a device that has dependencies. It is true if the user
selected either TV or radio media devices. It works together with 
MEDIA_SUBDRV_AUTOSELECT. When both are enabled, it selects all
media tuners. That makes easier for end users to not need to worry about
manually selecting the needed tuners.

Advanced users may, instead, manually select the media tuner that his
hardware needs. In such case, it doesn't matter if MEDIA_TUNER
is enabled or not.

As this is due to a Kconfig limitation, I've no idea how to fix or get
hid of it, but making em28xx dependent of MEDIA_TUNER is wrong.

Also, as this is a Kconfig hidden option, making em28xx dependent of
MEDIA_TUNER would actually disable it, if no other media driver is
compiled.

The problem here is that the em28xx driver is used by several different
types of devices:

- pure webcam devices. Those devices don't have a tuner;
- stream capture devices. Those devices don't have a tuner;
- analog TV devices. For analog TV to work, MEDIA_TUNER is needed. Still,
  most of those devices have Composite and S-VIDEO ports. It is possible
  to use the driver for stream capture on those ports even if MEDIA_TUNER
  is not compiled;
- digital TV devices. Those require either a tuner or a DVB frontend.
- any combination of the above.

Regards,
Mauro

> 
> This adds a dependency on MEDIA_TUNER to avoid the warning.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/media/usb/em28xx/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/em28xx/Kconfig b/drivers/media/usb/em28xx/Kconfig
> index 75323f5efd0f..cacc757e2254 100644
> --- a/drivers/media/usb/em28xx/Kconfig
> +++ b/drivers/media/usb/em28xx/Kconfig
> @@ -1,6 +1,6 @@
>  config VIDEO_EM28XX
>  	tristate "Empia EM28xx USB devices support"
> -	depends on VIDEO_DEV && I2C
> +	depends on VIDEO_DEV && I2C && MEDIA_TUNER
>  	select VIDEO_TUNER
>  	select VIDEO_TVEEPROM
>  

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

* Re: [PATCH 1/7] [media] pwc: hide unused label
  2016-01-26 14:09 ` Arnd Bergmann
@ 2016-01-26 14:40   ` kbuild test robot
  -1 siblings, 0 replies; 36+ messages in thread
From: kbuild test robot @ 2016-01-26 14:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kbuild-all, Hans de Goede, Mauro Carvalho Chehab,
	linux-arm-kernel, Arnd Bergmann, Hans Verkuil, linux-media,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2456 bytes --]

Hi Arnd,

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.5-rc1 next-20160125]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/pwc-hide-unused-label/20160126-221727
base:   git://linuxtv.org/media_tree.git master
config: xtensa-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe':
>> drivers/media/usb/pwc/pwc-if.c:1092:3: error: label 'err_video_unreg' used but not defined
      goto err_video_unreg;
      ^

vim +/err_video_unreg +1092 drivers/media/usb/pwc/pwc-if.c

479567ce3 drivers/media/video/pwc/pwc-if.c Hans Verkuil    2010-09-12  1086  
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Phạm Thành  2009-01-12  1087  #ifdef CONFIG_USB_PWC_INPUT_EVDEV
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Phạm Thành  2009-01-12  1088  	/* register webcam snapshot button input device */
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Phạm Thành  2009-01-12  1089  	pdev->button_dev = input_allocate_device();
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Phạm Thành  2009-01-12  1090  	if (!pdev->button_dev) {
89dec01b7 drivers/media/video/pwc/pwc-if.c Dmitry Torokhov 2009-08-14  1091  		rc = -ENOMEM;
89dec01b7 drivers/media/video/pwc/pwc-if.c Dmitry Torokhov 2009-08-14 @1092  		goto err_video_unreg;
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Phạm Thành  2009-01-12  1093  	}
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Phạm Thành  2009-01-12  1094  
89dec01b7 drivers/media/video/pwc/pwc-if.c Dmitry Torokhov 2009-08-14  1095  	usb_make_path(udev, pdev->button_phys, sizeof(pdev->button_phys));

:::::: The code at line 1092 was first introduced by commit
:::::: 89dec01b7e251697720ac3d6a5310d72359eba69 V4L/DVB (12489): pwc - fix few use-after-free and memory leaks

:::::: TO: Dmitry Torokhov <dmitry.torokhov@gmail.com>
:::::: CC: Mauro Carvalho Chehab <mchehab@redhat.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 44066 bytes --]

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

* [PATCH 1/7] [media] pwc: hide unused label
@ 2016-01-26 14:40   ` kbuild test robot
  0 siblings, 0 replies; 36+ messages in thread
From: kbuild test robot @ 2016-01-26 14:40 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.5-rc1 next-20160125]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/pwc-hide-unused-label/20160126-221727
base:   git://linuxtv.org/media_tree.git master
config: xtensa-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe':
>> drivers/media/usb/pwc/pwc-if.c:1092:3: error: label 'err_video_unreg' used but not defined
      goto err_video_unreg;
      ^

vim +/err_video_unreg +1092 drivers/media/usb/pwc/pwc-if.c

479567ce3 drivers/media/video/pwc/pwc-if.c Hans Verkuil    2010-09-12  1086  
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Ph?m Th?nh  2009-01-12  1087  #ifdef CONFIG_USB_PWC_INPUT_EVDEV
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Ph?m Th?nh  2009-01-12  1088  	/* register webcam snapshot button input device */
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Ph?m Th?nh  2009-01-12  1089  	pdev->button_dev = input_allocate_device();
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Ph?m Th?nh  2009-01-12  1090  	if (!pdev->button_dev) {
89dec01b7 drivers/media/video/pwc/pwc-if.c Dmitry Torokhov 2009-08-14  1091  		rc = -ENOMEM;
89dec01b7 drivers/media/video/pwc/pwc-if.c Dmitry Torokhov 2009-08-14 @1092  		goto err_video_unreg;
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Ph?m Th?nh  2009-01-12  1093  	}
e32a7eccd drivers/media/video/pwc/pwc-if.c Nam Ph?m Th?nh  2009-01-12  1094  
89dec01b7 drivers/media/video/pwc/pwc-if.c Dmitry Torokhov 2009-08-14  1095  	usb_make_path(udev, pdev->button_phys, sizeof(pdev->button_phys));

:::::: The code at line 1092 was first introduced by commit
:::::: 89dec01b7e251697720ac3d6a5310d72359eba69 V4L/DVB (12489): pwc - fix few use-after-free and memory leaks

:::::: TO: Dmitry Torokhov <dmitry.torokhov@gmail.com>
:::::: CC: Mauro Carvalho Chehab <mchehab@redhat.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 44066 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160126/06efdb71/attachment-0001.obj>

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

* Re: [PATCH 7/7] [media] go7007: add MEDIA_CAMERA_SUPPORT dependency
  2016-01-26 14:10   ` Arnd Bergmann
@ 2016-01-26 15:04     ` Mauro Carvalho Chehab
  -1 siblings, 0 replies; 36+ messages in thread
From: Mauro Carvalho Chehab @ 2016-01-26 15:04 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Hans Verkuil, linux-arm-kernel, linux-media, linux-kernel

Em Tue, 26 Jan 2016 15:10:01 +0100
Arnd Bergmann <arnd@arndb.de> escreveu:

> If MEDIA_SUBDRV_AUTOSELECT and VIDEO_GO7007 are both set, we
> automatically select VIDEO_OV7640, but that depends on MEDIA_CAMERA_SUPPORT,
> so we get a Kconfig warning if that is disabled:
> 
> warning: (VIDEO_GO7007) selects VIDEO_OV7640 which has unmet direct dependencies (MEDIA_SUPPORT && I2C && VIDEO_V4L2 && MEDIA_CAMERA_SUPPORT)
> 
> This adds another dependency so we don't accidentally select
> it when it is unavailable.

This is another bogus warning.

The MEDIA_foo_SUPPORT actually controls what drivers are visible,
but it doesn't enable any driver. They just control the visibility
of the drivers, and the APIs that will be enabled (V4L2 and/or DVB).

The aim of MEDIA_foo_SUPPORT is to make life easier to end users,
making easier for them to filter the drivers that they may need.

If one selects MEDIA_VIDEO_SUPPORT, the V4L2 API (and V4L core) will be 
enabled, and all drivers that support a camera should appear at the 
menu, including drivers that *also* support other features (like TV
and/or stream support).

That's the case of go7007.

That has nothing to do with the features selection for such driver.

Once go7007 driver is selected, if MEDIA_SUBDRV_AUTOSELECT, all
i2c drivers that cope together with go7007 are selected, making the
driver to fully support all devices it knows.

Advanced users may unselect MEDIA_SUBDRV_AUTOSELECT and add there just
the I2C driver(s) it needs for his specific hardware.

Despite the warning, the Kconfig will do the right thing, not
allowing invalid configurations.

Regards,
Mauro


> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/media/usb/go7007/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/go7007/Kconfig b/drivers/media/usb/go7007/Kconfig
> index 95a3af644a92..af1d02430931 100644
> --- a/drivers/media/usb/go7007/Kconfig
> +++ b/drivers/media/usb/go7007/Kconfig
> @@ -11,7 +11,7 @@ config VIDEO_GO7007
>  	select VIDEO_TW2804 if MEDIA_SUBDRV_AUTOSELECT
>  	select VIDEO_TW9903 if MEDIA_SUBDRV_AUTOSELECT
>  	select VIDEO_TW9906 if MEDIA_SUBDRV_AUTOSELECT
> -	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT
> +	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
>  	select VIDEO_UDA1342 if MEDIA_SUBDRV_AUTOSELECT
>  	---help---
>  	  This is a video4linux driver for the WIS GO7007 MPEG

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

* [PATCH 7/7] [media] go7007: add MEDIA_CAMERA_SUPPORT dependency
@ 2016-01-26 15:04     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 36+ messages in thread
From: Mauro Carvalho Chehab @ 2016-01-26 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

Em Tue, 26 Jan 2016 15:10:01 +0100
Arnd Bergmann <arnd@arndb.de> escreveu:

> If MEDIA_SUBDRV_AUTOSELECT and VIDEO_GO7007 are both set, we
> automatically select VIDEO_OV7640, but that depends on MEDIA_CAMERA_SUPPORT,
> so we get a Kconfig warning if that is disabled:
> 
> warning: (VIDEO_GO7007) selects VIDEO_OV7640 which has unmet direct dependencies (MEDIA_SUPPORT && I2C && VIDEO_V4L2 && MEDIA_CAMERA_SUPPORT)
> 
> This adds another dependency so we don't accidentally select
> it when it is unavailable.

This is another bogus warning.

The MEDIA_foo_SUPPORT actually controls what drivers are visible,
but it doesn't enable any driver. They just control the visibility
of the drivers, and the APIs that will be enabled (V4L2 and/or DVB).

The aim of MEDIA_foo_SUPPORT is to make life easier to end users,
making easier for them to filter the drivers that they may need.

If one selects MEDIA_VIDEO_SUPPORT, the V4L2 API (and V4L core) will be 
enabled, and all drivers that support a camera should appear at the 
menu, including drivers that *also* support other features (like TV
and/or stream support).

That's the case of go7007.

That has nothing to do with the features selection for such driver.

Once go7007 driver is selected, if MEDIA_SUBDRV_AUTOSELECT, all
i2c drivers that cope together with go7007 are selected, making the
driver to fully support all devices it knows.

Advanced users may unselect MEDIA_SUBDRV_AUTOSELECT and add there just
the I2C driver(s) it needs for his specific hardware.

Despite the warning, the Kconfig will do the right thing, not
allowing invalid configurations.

Regards,
Mauro


> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/media/usb/go7007/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/go7007/Kconfig b/drivers/media/usb/go7007/Kconfig
> index 95a3af644a92..af1d02430931 100644
> --- a/drivers/media/usb/go7007/Kconfig
> +++ b/drivers/media/usb/go7007/Kconfig
> @@ -11,7 +11,7 @@ config VIDEO_GO7007
>  	select VIDEO_TW2804 if MEDIA_SUBDRV_AUTOSELECT
>  	select VIDEO_TW9903 if MEDIA_SUBDRV_AUTOSELECT
>  	select VIDEO_TW9906 if MEDIA_SUBDRV_AUTOSELECT
> -	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT
> +	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT
>  	select VIDEO_UDA1342 if MEDIA_SUBDRV_AUTOSELECT
>  	---help---
>  	  This is a video4linux driver for the WIS GO7007 MPEG

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

* Re: [PATCH 1/7] [media] pwc: hide unused label
  2016-01-26 14:09 ` Arnd Bergmann
@ 2016-01-26 15:29   ` Arnd Bergmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 15:29 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Hans de Goede, Mauro Carvalho Chehab, linux-kernel, Hans Verkuil,
	linux-media

On Tuesday 26 January 2016 15:09:55 Arnd Bergmann wrote:
> The pwc driver causes a warning when CONFIG_USB_PWC_INPUT_EVDEV is unset:
> 
> drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe':
> drivers/media/usb/pwc/pwc-if.c:1115:1: warning: label 'err_video_unreg' defined but not used [-Wunused-label]
> 
> Obviously, the cleanup of &pdev->vdev is not needed without the input device,
> so we can just move it inside of the existing #ifdef and remove the
> extra label.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 

Please ignore patch 1. I made some late changes and failed to noticed
the build failure I introduced in another configuration.

	Arnd

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

* [PATCH 1/7] [media] pwc: hide unused label
@ 2016-01-26 15:29   ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 15:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 26 January 2016 15:09:55 Arnd Bergmann wrote:
> The pwc driver causes a warning when CONFIG_USB_PWC_INPUT_EVDEV is unset:
> 
> drivers/media/usb/pwc/pwc-if.c: In function 'usb_pwc_probe':
> drivers/media/usb/pwc/pwc-if.c:1115:1: warning: label 'err_video_unreg' defined but not used [-Wunused-label]
> 
> Obviously, the cleanup of &pdev->vdev is not needed without the input device,
> so we can just move it inside of the existing #ifdef and remove the
> extra label.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 

Please ignore patch 1. I made some late changes and failed to noticed
the build failure I introduced in another configuration.

	Arnd

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

* Re: [PATCH 7/7] [media] go7007: add MEDIA_CAMERA_SUPPORT dependency
  2016-01-26 15:04     ` Mauro Carvalho Chehab
@ 2016-01-26 15:41       ` Mauro Carvalho Chehab
  -1 siblings, 0 replies; 36+ messages in thread
From: Mauro Carvalho Chehab @ 2016-01-26 15:41 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Hans Verkuil, linux-arm-kernel, linux-media, linux-kernel

Em Tue, 26 Jan 2016 13:04:03 -0200
Mauro Carvalho Chehab <mchehab@osg.samsung.com> escreveu:

> Em Tue, 26 Jan 2016 15:10:01 +0100
> Arnd Bergmann <arnd@arndb.de> escreveu:
> 
> > If MEDIA_SUBDRV_AUTOSELECT and VIDEO_GO7007 are both set, we
> > automatically select VIDEO_OV7640, but that depends on MEDIA_CAMERA_SUPPORT,
> > so we get a Kconfig warning if that is disabled:
> > 
> > warning: (VIDEO_GO7007) selects VIDEO_OV7640 which has unmet direct dependencies (MEDIA_SUPPORT && I2C && VIDEO_V4L2 && MEDIA_CAMERA_SUPPORT)
> > 
> > This adds another dependency so we don't accidentally select
> > it when it is unavailable.  
> 
> This is another bogus warning.
> 
> The MEDIA_foo_SUPPORT actually controls what drivers are visible,
> but it doesn't enable any driver. They just control the visibility
> of the drivers, and the APIs that will be enabled (V4L2 and/or DVB).
> 
> The aim of MEDIA_foo_SUPPORT is to make life easier to end users,
> making easier for them to filter the drivers that they may need.
> 
> If one selects MEDIA_VIDEO_SUPPORT, the V4L2 API (and V4L core) will be 
> enabled, and all drivers that support a camera should appear at the 
> menu, including drivers that *also* support other features (like TV
> and/or stream support).
> 
> That's the case of go7007.
> 
> That has nothing to do with the features selection for such driver.
> 
> Once go7007 driver is selected, if MEDIA_SUBDRV_AUTOSELECT, all
> i2c drivers that cope together with go7007 are selected, making the
> driver to fully support all devices it knows.
> 
> Advanced users may unselect MEDIA_SUBDRV_AUTOSELECT and add there just
> the I2C driver(s) it needs for his specific hardware.
> 
> Despite the warning, the Kconfig will do the right thing, not
> allowing invalid configurations.
> 
> Regards,
> Mauro
> 
> 
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/media/usb/go7007/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/media/usb/go7007/Kconfig b/drivers/media/usb/go7007/Kconfig
> > index 95a3af644a92..af1d02430931 100644
> > --- a/drivers/media/usb/go7007/Kconfig
> > +++ b/drivers/media/usb/go7007/Kconfig
> > @@ -11,7 +11,7 @@ config VIDEO_GO7007
> >  	select VIDEO_TW2804 if MEDIA_SUBDRV_AUTOSELECT
> >  	select VIDEO_TW9903 if MEDIA_SUBDRV_AUTOSELECT
> >  	select VIDEO_TW9906 if MEDIA_SUBDRV_AUTOSELECT
> > -	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT
> > +	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT

Hmm... on a second thought, it could make sense to only auto-select
the sensor drivers if MEDIA_CAMERA_SUPPORT, and to only auto-select
tuners if MEDIA_*_TV_SUPPORT is selected.

However, in this case, we'll need to dig into all Kconfig autoselect
options in order to make it right.

I guess we should also likely need to document to the user that the
driver won't be fully supported, as we'll be changing the behavior
of the menus.

Comments?

Regards,
Mauro

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

* [PATCH 7/7] [media] go7007: add MEDIA_CAMERA_SUPPORT dependency
@ 2016-01-26 15:41       ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 36+ messages in thread
From: Mauro Carvalho Chehab @ 2016-01-26 15:41 UTC (permalink / raw)
  To: linux-arm-kernel

Em Tue, 26 Jan 2016 13:04:03 -0200
Mauro Carvalho Chehab <mchehab@osg.samsung.com> escreveu:

> Em Tue, 26 Jan 2016 15:10:01 +0100
> Arnd Bergmann <arnd@arndb.de> escreveu:
> 
> > If MEDIA_SUBDRV_AUTOSELECT and VIDEO_GO7007 are both set, we
> > automatically select VIDEO_OV7640, but that depends on MEDIA_CAMERA_SUPPORT,
> > so we get a Kconfig warning if that is disabled:
> > 
> > warning: (VIDEO_GO7007) selects VIDEO_OV7640 which has unmet direct dependencies (MEDIA_SUPPORT && I2C && VIDEO_V4L2 && MEDIA_CAMERA_SUPPORT)
> > 
> > This adds another dependency so we don't accidentally select
> > it when it is unavailable.  
> 
> This is another bogus warning.
> 
> The MEDIA_foo_SUPPORT actually controls what drivers are visible,
> but it doesn't enable any driver. They just control the visibility
> of the drivers, and the APIs that will be enabled (V4L2 and/or DVB).
> 
> The aim of MEDIA_foo_SUPPORT is to make life easier to end users,
> making easier for them to filter the drivers that they may need.
> 
> If one selects MEDIA_VIDEO_SUPPORT, the V4L2 API (and V4L core) will be 
> enabled, and all drivers that support a camera should appear at the 
> menu, including drivers that *also* support other features (like TV
> and/or stream support).
> 
> That's the case of go7007.
> 
> That has nothing to do with the features selection for such driver.
> 
> Once go7007 driver is selected, if MEDIA_SUBDRV_AUTOSELECT, all
> i2c drivers that cope together with go7007 are selected, making the
> driver to fully support all devices it knows.
> 
> Advanced users may unselect MEDIA_SUBDRV_AUTOSELECT and add there just
> the I2C driver(s) it needs for his specific hardware.
> 
> Despite the warning, the Kconfig will do the right thing, not
> allowing invalid configurations.
> 
> Regards,
> Mauro
> 
> 
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/media/usb/go7007/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/media/usb/go7007/Kconfig b/drivers/media/usb/go7007/Kconfig
> > index 95a3af644a92..af1d02430931 100644
> > --- a/drivers/media/usb/go7007/Kconfig
> > +++ b/drivers/media/usb/go7007/Kconfig
> > @@ -11,7 +11,7 @@ config VIDEO_GO7007
> >  	select VIDEO_TW2804 if MEDIA_SUBDRV_AUTOSELECT
> >  	select VIDEO_TW9903 if MEDIA_SUBDRV_AUTOSELECT
> >  	select VIDEO_TW9906 if MEDIA_SUBDRV_AUTOSELECT
> > -	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT
> > +	select VIDEO_OV7640 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_CAMERA_SUPPORT

Hmm... on a second thought, it could make sense to only auto-select
the sensor drivers if MEDIA_CAMERA_SUPPORT, and to only auto-select
tuners if MEDIA_*_TV_SUPPORT is selected.

However, in this case, we'll need to dig into all Kconfig autoselect
options in order to make it right.

I guess we should also likely need to document to the user that the
driver won't be fully supported, as we'll be changing the behavior
of the menus.

Comments?

Regards,
Mauro

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

* Re: [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
  2016-01-26 14:33     ` Mauro Carvalho Chehab
@ 2016-01-26 15:53       ` Arnd Bergmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 15:53 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Hans Verkuil, linux-media, linux-kernel

On Tuesday 26 January 2016 12:33:08 Mauro Carvalho Chehab wrote:
> Em Tue, 26 Jan 2016 15:10:00 +0100
> Arnd Bergmann <arnd@arndb.de> escreveu:
> 
> > em28xx selects VIDEO_TUNER, which has a dependency on MEDIA_TUNER,
> > so we get a Kconfig warning if that is disabled:
> > 
> > warning: (VIDEO_PVRUSB2 && VIDEO_USBVISION && VIDEO_GO7007 && VIDEO_AU0828_V4L2 && VIDEO_CX231XX && VIDEO_TM6000 && VIDEO_EM28XX && VIDEO_IVTV && VIDEO_MXB && VIDEO_CX18 && VIDEO_CX23885 && VIDEO_CX88 && VIDEO_BT848 && VIDEO_SAA7134 && VIDEO_SAA7164) selects VIDEO_TUNER which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_TUNER)
> 
> This warning is bogus, as it is OK to select VIDEO_TUNER even if MEDIA_TUNER
> is not defined.
> 
> See how MEDIA_TUNER is defined:
> 
> 
> config MEDIA_TUNER
> 	tristate
> 	depends on (MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT) && I2C
> 	default y
> 	select MEDIA_TUNER_XC2028 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_XC4000 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_MT20XX if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_TDA8290 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_TEA5761 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
> 	select MEDIA_TUNER_TEA5767 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
> 	select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_TDA9887 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_MC44S803 if MEDIA_SUBDRV_AUTOSELECT
> 
> MEDIA_TUNER is just one of the media Kconfig workarounds to its limitation of
> not allowing to select a device that has dependencies. It is true if the user
> selected either TV or radio media devices. It works together with 
> MEDIA_SUBDRV_AUTOSELECT. When both are enabled, it selects all
> media tuners. That makes easier for end users to not need to worry about
> manually selecting the needed tuners.
> 
> Advanced users may, instead, manually select the media tuner that his
> hardware needs. In such case, it doesn't matter if MEDIA_TUNER
> is enabled or not.
> 
> As this is due to a Kconfig limitation, I've no idea how to fix or get
> hid of it, but making em28xx dependent of MEDIA_TUNER is wrong.

I don't understand what limitation you see here. The definition
of the VIDEO_TUNER symbol is an empty 'tristate' symbol with a
dependency on MEDIA_TUNER to ensure we get a warning if MEDIA_TUNER
is not enabled, and to ensure it is set to 'm' if MEDIA_TUNER=m and
a "bool" driver selects VIDEO_TUNER.

You are saying that the first one is not correct, so I assume we
still need the second meaning. We could probably do that like the
patch below (untested) that makes the intention much more explicit.

	Arnd

diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
index 9beece00869b..1050bdf1848f 100644
--- a/drivers/media/v4l2-core/Kconfig
+++ b/drivers/media/v4l2-core/Kconfig
@@ -37,7 +37,11 @@ config VIDEO_PCI_SKELETON
 # Used by drivers that need tuner.ko
 config VIDEO_TUNER
 	tristate
-	depends on MEDIA_TUNER
+
+config VIDEO_TUNER_MODULE
+	tristate # must not be built-in if MEDIA_TUNER=m because of I2C
+	default y if VIDEO_TUNER=y || MEDIA_TUNER=y
+	default m if VIDEO_TUNER=m
 
 # Used by drivers that need v4l2-mem2mem.ko
 config V4L2_MEM2MEM_DEV
diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
index 1dc8bba2b198..971af6398d6d 100644
--- a/drivers/media/v4l2-core/Makefile
+++ b/drivers/media/v4l2-core/Makefile
@@ -21,7 +21,7 @@ obj-$(CONFIG_VIDEO_V4L2) += videodev.o
 obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
 obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
 
-obj-$(CONFIG_VIDEO_TUNER) += tuner.o
+obj-$(CONFIG_VIDEO_TUNER_MODULE) += tuner.o
 
 obj-$(CONFIG_V4L2_MEM2MEM_DEV) += v4l2-mem2mem.o
 

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

* [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
@ 2016-01-26 15:53       ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 15:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 26 January 2016 12:33:08 Mauro Carvalho Chehab wrote:
> Em Tue, 26 Jan 2016 15:10:00 +0100
> Arnd Bergmann <arnd@arndb.de> escreveu:
> 
> > em28xx selects VIDEO_TUNER, which has a dependency on MEDIA_TUNER,
> > so we get a Kconfig warning if that is disabled:
> > 
> > warning: (VIDEO_PVRUSB2 && VIDEO_USBVISION && VIDEO_GO7007 && VIDEO_AU0828_V4L2 && VIDEO_CX231XX && VIDEO_TM6000 && VIDEO_EM28XX && VIDEO_IVTV && VIDEO_MXB && VIDEO_CX18 && VIDEO_CX23885 && VIDEO_CX88 && VIDEO_BT848 && VIDEO_SAA7134 && VIDEO_SAA7164) selects VIDEO_TUNER which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_TUNER)
> 
> This warning is bogus, as it is OK to select VIDEO_TUNER even if MEDIA_TUNER
> is not defined.
> 
> See how MEDIA_TUNER is defined:
> 
> 
> config MEDIA_TUNER
> 	tristate
> 	depends on (MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT) && I2C
> 	default y
> 	select MEDIA_TUNER_XC2028 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_XC4000 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_MT20XX if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_TDA8290 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_TEA5761 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
> 	select MEDIA_TUNER_TEA5767 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
> 	select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_TDA9887 if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_TUNER_MC44S803 if MEDIA_SUBDRV_AUTOSELECT
> 
> MEDIA_TUNER is just one of the media Kconfig workarounds to its limitation of
> not allowing to select a device that has dependencies. It is true if the user
> selected either TV or radio media devices. It works together with 
> MEDIA_SUBDRV_AUTOSELECT. When both are enabled, it selects all
> media tuners. That makes easier for end users to not need to worry about
> manually selecting the needed tuners.
> 
> Advanced users may, instead, manually select the media tuner that his
> hardware needs. In such case, it doesn't matter if MEDIA_TUNER
> is enabled or not.
> 
> As this is due to a Kconfig limitation, I've no idea how to fix or get
> hid of it, but making em28xx dependent of MEDIA_TUNER is wrong.

I don't understand what limitation you see here. The definition
of the VIDEO_TUNER symbol is an empty 'tristate' symbol with a
dependency on MEDIA_TUNER to ensure we get a warning if MEDIA_TUNER
is not enabled, and to ensure it is set to 'm' if MEDIA_TUNER=m and
a "bool" driver selects VIDEO_TUNER.

You are saying that the first one is not correct, so I assume we
still need the second meaning. We could probably do that like the
patch below (untested) that makes the intention much more explicit.

	Arnd

diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
index 9beece00869b..1050bdf1848f 100644
--- a/drivers/media/v4l2-core/Kconfig
+++ b/drivers/media/v4l2-core/Kconfig
@@ -37,7 +37,11 @@ config VIDEO_PCI_SKELETON
 # Used by drivers that need tuner.ko
 config VIDEO_TUNER
 	tristate
-	depends on MEDIA_TUNER
+
+config VIDEO_TUNER_MODULE
+	tristate # must not be built-in if MEDIA_TUNER=m because of I2C
+	default y if VIDEO_TUNER=y || MEDIA_TUNER=y
+	default m if VIDEO_TUNER=m
 
 # Used by drivers that need v4l2-mem2mem.ko
 config V4L2_MEM2MEM_DEV
diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
index 1dc8bba2b198..971af6398d6d 100644
--- a/drivers/media/v4l2-core/Makefile
+++ b/drivers/media/v4l2-core/Makefile
@@ -21,7 +21,7 @@ obj-$(CONFIG_VIDEO_V4L2) += videodev.o
 obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
 obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
 
-obj-$(CONFIG_VIDEO_TUNER) += tuner.o
+obj-$(CONFIG_VIDEO_TUNER_MODULE) += tuner.o
 
 obj-$(CONFIG_V4L2_MEM2MEM_DEV) += v4l2-mem2mem.o
 

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

* Re: [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
  2016-01-26 15:53       ` Arnd Bergmann
@ 2016-01-26 16:36         ` Mauro Carvalho Chehab
  -1 siblings, 0 replies; 36+ messages in thread
From: Mauro Carvalho Chehab @ 2016-01-26 16:36 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arm-kernel, Hans Verkuil, linux-media, linux-kernel

Em Tue, 26 Jan 2016 16:53:38 +0100
Arnd Bergmann <arnd@arndb.de> escreveu:

> On Tuesday 26 January 2016 12:33:08 Mauro Carvalho Chehab wrote:
> > Em Tue, 26 Jan 2016 15:10:00 +0100
> > Arnd Bergmann <arnd@arndb.de> escreveu:
> >   
> > > em28xx selects VIDEO_TUNER, which has a dependency on MEDIA_TUNER,
> > > so we get a Kconfig warning if that is disabled:
> > > 
> > > warning: (VIDEO_PVRUSB2 && VIDEO_USBVISION && VIDEO_GO7007 && VIDEO_AU0828_V4L2 && VIDEO_CX231XX && VIDEO_TM6000 && VIDEO_EM28XX && VIDEO_IVTV && VIDEO_MXB && VIDEO_CX18 && VIDEO_CX23885 && VIDEO_CX88 && VIDEO_BT848 && VIDEO_SAA7134 && VIDEO_SAA7164) selects VIDEO_TUNER which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_TUNER)  
> > 
> > This warning is bogus, as it is OK to select VIDEO_TUNER even if MEDIA_TUNER
> > is not defined.
> > 
> > See how MEDIA_TUNER is defined:
> > 
> > 
> > config MEDIA_TUNER
> > 	tristate
> > 	depends on (MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT) && I2C
> > 	default y
> > 	select MEDIA_TUNER_XC2028 if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_XC4000 if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_MT20XX if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_TDA8290 if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_TEA5761 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
> > 	select MEDIA_TUNER_TEA5767 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
> > 	select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_TDA9887 if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_MC44S803 if MEDIA_SUBDRV_AUTOSELECT
> > 
> > MEDIA_TUNER is just one of the media Kconfig workarounds to its limitation of
> > not allowing to select a device that has dependencies. It is true if the user
> > selected either TV or radio media devices. It works together with 
> > MEDIA_SUBDRV_AUTOSELECT. When both are enabled, it selects all
> > media tuners. That makes easier for end users to not need to worry about
> > manually selecting the needed tuners.
> > 
> > Advanced users may, instead, manually select the media tuner that his
> > hardware needs. In such case, it doesn't matter if MEDIA_TUNER
> > is enabled or not.
> > 
> > As this is due to a Kconfig limitation, I've no idea how to fix or get
> > hid of it, but making em28xx dependent of MEDIA_TUNER is wrong.  
> 
> I don't understand what limitation you see here. 

Before MEDIA_TUNER, what we had was something like:

	config MEDIA_driver_foo
	select VIDEO_tuner_bar if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_frontend_foobar if MEDIA_SUBDRV_AUTOSELECT
	...

However, as different I2C drivers had different dependencies, this
used to cause lots of troubles. So, one of the Kbuild maintainers
came out with the idea of converting from select into depends on.
The MEDIA_TUNER is just an ancillary invisible option to make it
work at the tuner's side, as usually what we want is to have all
tuners selected, as we don't have a one to one mapping about what
driver supports what tuner (nor we wanted to do it, as this would
mean lots of work for not much gain).

> The definition
> of the VIDEO_TUNER symbol is an empty 'tristate' symbol with a
> dependency on MEDIA_TUNER to ensure we get a warning if MEDIA_TUNER
> is not enabled, and to ensure it is set to 'm' if MEDIA_TUNER=m and
> a "bool" driver selects VIDEO_TUNER.

No, VIDEO_TUNER is there because we wanted to be able to use select
to enable V4L2 tuner core support and let people to manually select
the needed I2C devices with MEDIA_SUBDRV_AUTOSELECT unselected.

> 
> You are saying that the first one is not correct, so I assume we
> still need the second meaning. We could probably do that like the
> patch below (untested) that makes the intention much more explicit.
> 
> 	Arnd
> 
> diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> index 9beece00869b..1050bdf1848f 100644
> --- a/drivers/media/v4l2-core/Kconfig
> +++ b/drivers/media/v4l2-core/Kconfig
> @@ -37,7 +37,11 @@ config VIDEO_PCI_SKELETON
>  # Used by drivers that need tuner.ko
>  config VIDEO_TUNER
>  	tristate
> -	depends on MEDIA_TUNER
> +
> +config VIDEO_TUNER_MODULE
> +	tristate # must not be built-in if MEDIA_TUNER=m because of I2C
> +	default y if VIDEO_TUNER=y || MEDIA_TUNER=y
> +	default m if VIDEO_TUNER=m

Doesn't need to worry about that, because all drivers that select VIDEO_TUNER
depend on I2C:

drivers/media/pci/bt8xx/Kconfig:        select VIDEO_TUNER
drivers/media/pci/cx18/Kconfig: select VIDEO_TUNER
drivers/media/pci/cx23885/Kconfig:      select VIDEO_TUNER
drivers/media/pci/cx88/Kconfig: select VIDEO_TUNER
drivers/media/pci/ivtv/Kconfig: select VIDEO_TUNER
drivers/media/pci/saa7134/Kconfig:      select VIDEO_TUNER
drivers/media/pci/saa7146/Kconfig:      select VIDEO_TUNER
drivers/media/pci/saa7164/Kconfig:      select VIDEO_TUNER
drivers/media/usb/au0828/Kconfig:       select VIDEO_TUNER
drivers/media/usb/cx231xx/Kconfig:      select VIDEO_TUNER
drivers/media/usb/em28xx/Kconfig:       select VIDEO_TUNER
drivers/media/usb/go7007/Kconfig:       select VIDEO_TUNER
drivers/media/usb/pvrusb2/Kconfig:      select VIDEO_TUNER
drivers/media/usb/tm6000/Kconfig:       select VIDEO_TUNER
drivers/media/usb/usbvision/Kconfig:    select VIDEO_TUNER

This will always be the case for PCI/USB drivers that support analog TV,
as those drivers need to implement the I2C adapter code inside them.

>  
>  # Used by drivers that need v4l2-mem2mem.ko
>  config V4L2_MEM2MEM_DEV
> diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
> index 1dc8bba2b198..971af6398d6d 100644
> --- a/drivers/media/v4l2-core/Makefile
> +++ b/drivers/media/v4l2-core/Makefile
> @@ -21,7 +21,7 @@ obj-$(CONFIG_VIDEO_V4L2) += videodev.o
>  obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
>  obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
>  
> -obj-$(CONFIG_VIDEO_TUNER) += tuner.o
> +obj-$(CONFIG_VIDEO_TUNER_MODULE) += tuner.o
>  
>  obj-$(CONFIG_V4L2_MEM2MEM_DEV) += v4l2-mem2mem.o

Yes, the above could work. This is simpler fix, and should work fine for
all current usecases:

diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
index 9beece00869b..b30e1c879a57 100644
--- a/drivers/media/v4l2-core/Kconfig
+++ b/drivers/media/v4l2-core/Kconfig
@@ -37,7 +37,7 @@ config VIDEO_PCI_SKELETON
 # Used by drivers that need tuner.ko
 config VIDEO_TUNER
 	tristate
-	depends on MEDIA_TUNER
+	default MEDIA_TUNER
 
 # Used by drivers that need v4l2-mem2mem.ko
 config V4L2_MEM2MEM_DEV


Ok, if we'll have platform drivers for analog TV using the I2C bus
at directly in SoC, then your solution is better, but the tuner core
driver may not be the best way of doing it. So, for now, I would use
the simpler version.

Regards,
Mauro

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

* [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
@ 2016-01-26 16:36         ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 36+ messages in thread
From: Mauro Carvalho Chehab @ 2016-01-26 16:36 UTC (permalink / raw)
  To: linux-arm-kernel

Em Tue, 26 Jan 2016 16:53:38 +0100
Arnd Bergmann <arnd@arndb.de> escreveu:

> On Tuesday 26 January 2016 12:33:08 Mauro Carvalho Chehab wrote:
> > Em Tue, 26 Jan 2016 15:10:00 +0100
> > Arnd Bergmann <arnd@arndb.de> escreveu:
> >   
> > > em28xx selects VIDEO_TUNER, which has a dependency on MEDIA_TUNER,
> > > so we get a Kconfig warning if that is disabled:
> > > 
> > > warning: (VIDEO_PVRUSB2 && VIDEO_USBVISION && VIDEO_GO7007 && VIDEO_AU0828_V4L2 && VIDEO_CX231XX && VIDEO_TM6000 && VIDEO_EM28XX && VIDEO_IVTV && VIDEO_MXB && VIDEO_CX18 && VIDEO_CX23885 && VIDEO_CX88 && VIDEO_BT848 && VIDEO_SAA7134 && VIDEO_SAA7164) selects VIDEO_TUNER which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_TUNER)  
> > 
> > This warning is bogus, as it is OK to select VIDEO_TUNER even if MEDIA_TUNER
> > is not defined.
> > 
> > See how MEDIA_TUNER is defined:
> > 
> > 
> > config MEDIA_TUNER
> > 	tristate
> > 	depends on (MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT || MEDIA_SDR_SUPPORT) && I2C
> > 	default y
> > 	select MEDIA_TUNER_XC2028 if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_XC4000 if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_MT20XX if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_TDA8290 if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_TEA5761 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
> > 	select MEDIA_TUNER_TEA5767 if MEDIA_SUBDRV_AUTOSELECT && MEDIA_RADIO_SUPPORT
> > 	select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_TDA9887 if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_TUNER_MC44S803 if MEDIA_SUBDRV_AUTOSELECT
> > 
> > MEDIA_TUNER is just one of the media Kconfig workarounds to its limitation of
> > not allowing to select a device that has dependencies. It is true if the user
> > selected either TV or radio media devices. It works together with 
> > MEDIA_SUBDRV_AUTOSELECT. When both are enabled, it selects all
> > media tuners. That makes easier for end users to not need to worry about
> > manually selecting the needed tuners.
> > 
> > Advanced users may, instead, manually select the media tuner that his
> > hardware needs. In such case, it doesn't matter if MEDIA_TUNER
> > is enabled or not.
> > 
> > As this is due to a Kconfig limitation, I've no idea how to fix or get
> > hid of it, but making em28xx dependent of MEDIA_TUNER is wrong.  
> 
> I don't understand what limitation you see here. 

Before MEDIA_TUNER, what we had was something like:

	config MEDIA_driver_foo
	select VIDEO_tuner_bar if MEDIA_SUBDRV_AUTOSELECT
	select MEDIA_frontend_foobar if MEDIA_SUBDRV_AUTOSELECT
	...

However, as different I2C drivers had different dependencies, this
used to cause lots of troubles. So, one of the Kbuild maintainers
came out with the idea of converting from select into depends on.
The MEDIA_TUNER is just an ancillary invisible option to make it
work at the tuner's side, as usually what we want is to have all
tuners selected, as we don't have a one to one mapping about what
driver supports what tuner (nor we wanted to do it, as this would
mean lots of work for not much gain).

> The definition
> of the VIDEO_TUNER symbol is an empty 'tristate' symbol with a
> dependency on MEDIA_TUNER to ensure we get a warning if MEDIA_TUNER
> is not enabled, and to ensure it is set to 'm' if MEDIA_TUNER=m and
> a "bool" driver selects VIDEO_TUNER.

No, VIDEO_TUNER is there because we wanted to be able to use select
to enable V4L2 tuner core support and let people to manually select
the needed I2C devices with MEDIA_SUBDRV_AUTOSELECT unselected.

> 
> You are saying that the first one is not correct, so I assume we
> still need the second meaning. We could probably do that like the
> patch below (untested) that makes the intention much more explicit.
> 
> 	Arnd
> 
> diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> index 9beece00869b..1050bdf1848f 100644
> --- a/drivers/media/v4l2-core/Kconfig
> +++ b/drivers/media/v4l2-core/Kconfig
> @@ -37,7 +37,11 @@ config VIDEO_PCI_SKELETON
>  # Used by drivers that need tuner.ko
>  config VIDEO_TUNER
>  	tristate
> -	depends on MEDIA_TUNER
> +
> +config VIDEO_TUNER_MODULE
> +	tristate # must not be built-in if MEDIA_TUNER=m because of I2C
> +	default y if VIDEO_TUNER=y || MEDIA_TUNER=y
> +	default m if VIDEO_TUNER=m

Doesn't need to worry about that, because all drivers that select VIDEO_TUNER
depend on I2C:

drivers/media/pci/bt8xx/Kconfig:        select VIDEO_TUNER
drivers/media/pci/cx18/Kconfig: select VIDEO_TUNER
drivers/media/pci/cx23885/Kconfig:      select VIDEO_TUNER
drivers/media/pci/cx88/Kconfig: select VIDEO_TUNER
drivers/media/pci/ivtv/Kconfig: select VIDEO_TUNER
drivers/media/pci/saa7134/Kconfig:      select VIDEO_TUNER
drivers/media/pci/saa7146/Kconfig:      select VIDEO_TUNER
drivers/media/pci/saa7164/Kconfig:      select VIDEO_TUNER
drivers/media/usb/au0828/Kconfig:       select VIDEO_TUNER
drivers/media/usb/cx231xx/Kconfig:      select VIDEO_TUNER
drivers/media/usb/em28xx/Kconfig:       select VIDEO_TUNER
drivers/media/usb/go7007/Kconfig:       select VIDEO_TUNER
drivers/media/usb/pvrusb2/Kconfig:      select VIDEO_TUNER
drivers/media/usb/tm6000/Kconfig:       select VIDEO_TUNER
drivers/media/usb/usbvision/Kconfig:    select VIDEO_TUNER

This will always be the case for PCI/USB drivers that support analog TV,
as those drivers need to implement the I2C adapter code inside them.

>  
>  # Used by drivers that need v4l2-mem2mem.ko
>  config V4L2_MEM2MEM_DEV
> diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
> index 1dc8bba2b198..971af6398d6d 100644
> --- a/drivers/media/v4l2-core/Makefile
> +++ b/drivers/media/v4l2-core/Makefile
> @@ -21,7 +21,7 @@ obj-$(CONFIG_VIDEO_V4L2) += videodev.o
>  obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
>  obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
>  
> -obj-$(CONFIG_VIDEO_TUNER) += tuner.o
> +obj-$(CONFIG_VIDEO_TUNER_MODULE) += tuner.o
>  
>  obj-$(CONFIG_V4L2_MEM2MEM_DEV) += v4l2-mem2mem.o

Yes, the above could work. This is simpler fix, and should work fine for
all current usecases:

diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
index 9beece00869b..b30e1c879a57 100644
--- a/drivers/media/v4l2-core/Kconfig
+++ b/drivers/media/v4l2-core/Kconfig
@@ -37,7 +37,7 @@ config VIDEO_PCI_SKELETON
 # Used by drivers that need tuner.ko
 config VIDEO_TUNER
 	tristate
-	depends on MEDIA_TUNER
+	default MEDIA_TUNER
 
 # Used by drivers that need v4l2-mem2mem.ko
 config V4L2_MEM2MEM_DEV


Ok, if we'll have platform drivers for analog TV using the I2C bus
at directly in SoC, then your solution is better, but the tuner core
driver may not be the best way of doing it. So, for now, I would use
the simpler version.

Regards,
Mauro

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

* Re: [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
  2016-01-26 16:36         ` Mauro Carvalho Chehab
@ 2016-01-26 16:51           ` Arnd Bergmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 16:51 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Hans Verkuil, linux-media, linux-kernel

On Tuesday 26 January 2016 14:36:44 Mauro Carvalho Chehab wrote:
> Em Tue, 26 Jan 2016 16:53:38 +0100
> Arnd Bergmann <arnd@arndb.de> escreveu:
> > On Tuesday 26 January 2016 12:33:08 Mauro Carvalho Chehab wrote:
> > > Em Tue, 26 Jan 2016 15:10:00 +0100
> > > Advanced users may, instead, manually select the media tuner that his
> > > hardware needs. In such case, it doesn't matter if MEDIA_TUNER
> > > is enabled or not.
> > > 
> > > As this is due to a Kconfig limitation, I've no idea how to fix or get
> > > hid of it, but making em28xx dependent of MEDIA_TUNER is wrong.  
> > 
> > I don't understand what limitation you see here. 
> 
> Before MEDIA_TUNER, what we had was something like:
> 
> 	config MEDIA_driver_foo
> 	select VIDEO_tuner_bar if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_frontend_foobar if MEDIA_SUBDRV_AUTOSELECT
> 	...
> 
> However, as different I2C drivers had different dependencies, this
> used to cause lots of troubles. So, one of the Kbuild maintainers
> came out with the idea of converting from select into depends on.
> The MEDIA_TUNER is just an ancillary invisible option to make it
> work at the tuner's side, as usually what we want is to have all
> tuners selected, as we don't have a one to one mapping about what
> driver supports what tuner (nor we wanted to do it, as this would
> mean lots of work for not much gain).

Ok

> > The definition
> > of the VIDEO_TUNER symbol is an empty 'tristate' symbol with a
> > dependency on MEDIA_TUNER to ensure we get a warning if MEDIA_TUNER
> > is not enabled, and to ensure it is set to 'm' if MEDIA_TUNER=m and
> > a "bool" driver selects VIDEO_TUNER.
> 
> No, VIDEO_TUNER is there because we wanted to be able to use select
> to enable V4L2 tuner core support and let people to manually select
> the needed I2C devices with MEDIA_SUBDRV_AUTOSELECT unselected.

I meant what the dependency is there for, not the symbol itself.
It's clear what the symbol does.

> > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > index 9beece00869b..1050bdf1848f 100644
> > --- a/drivers/media/v4l2-core/Kconfig
> > +++ b/drivers/media/v4l2-core/Kconfig
> > @@ -37,7 +37,11 @@ config VIDEO_PCI_SKELETON
> >  # Used by drivers that need tuner.ko
> >  config VIDEO_TUNER
> >  	tristate
> > -	depends on MEDIA_TUNER
> > +
> > +config VIDEO_TUNER_MODULE
> > +	tristate # must not be built-in if MEDIA_TUNER=m because of I2C
> > +	default y if VIDEO_TUNER=y || MEDIA_TUNER=y
> > +	default m if VIDEO_TUNER=m
> 
> Doesn't need to worry about that, because all drivers that select VIDEO_TUNER
> depend on I2C:
> 

Ok, then the dependency does not do anything other than generate a
warning.

> diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> index 9beece00869b..b30e1c879a57 100644
> --- a/drivers/media/v4l2-core/Kconfig
> +++ b/drivers/media/v4l2-core/Kconfig
> @@ -37,7 +37,7 @@ config VIDEO_PCI_SKELETON
>  # Used by drivers that need tuner.ko
>  config VIDEO_TUNER
>  	tristate
> -	depends on MEDIA_TUNER
> +	default MEDIA_TUNER
>  
>  # Used by drivers that need v4l2-mem2mem.ko
>  config V4L2_MEM2MEM_DEV

So this means it's now enabled if MEDIA_TUNER is enabled, whereas
before it was only enabled when explicitly selected. That sounds
like a useful change, but it also seems unrelated to the warning
fix, and should probably be a separate change, while for now
we can simply remove the 'depends on' line without any replacement.

> Ok, if we'll have platform drivers for analog TV using the I2C bus
> at directly in SoC, then your solution is better, but the tuner core
> driver may not be the best way of doing it. So, for now, I would use
> the simpler version.

Ok. Do you want me to submit a new version or do you prefer to write
one yourself? With or without the 'default'?

	Arnd

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

* [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
@ 2016-01-26 16:51           ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 16:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 26 January 2016 14:36:44 Mauro Carvalho Chehab wrote:
> Em Tue, 26 Jan 2016 16:53:38 +0100
> Arnd Bergmann <arnd@arndb.de> escreveu:
> > On Tuesday 26 January 2016 12:33:08 Mauro Carvalho Chehab wrote:
> > > Em Tue, 26 Jan 2016 15:10:00 +0100
> > > Advanced users may, instead, manually select the media tuner that his
> > > hardware needs. In such case, it doesn't matter if MEDIA_TUNER
> > > is enabled or not.
> > > 
> > > As this is due to a Kconfig limitation, I've no idea how to fix or get
> > > hid of it, but making em28xx dependent of MEDIA_TUNER is wrong.  
> > 
> > I don't understand what limitation you see here. 
> 
> Before MEDIA_TUNER, what we had was something like:
> 
> 	config MEDIA_driver_foo
> 	select VIDEO_tuner_bar if MEDIA_SUBDRV_AUTOSELECT
> 	select MEDIA_frontend_foobar if MEDIA_SUBDRV_AUTOSELECT
> 	...
> 
> However, as different I2C drivers had different dependencies, this
> used to cause lots of troubles. So, one of the Kbuild maintainers
> came out with the idea of converting from select into depends on.
> The MEDIA_TUNER is just an ancillary invisible option to make it
> work at the tuner's side, as usually what we want is to have all
> tuners selected, as we don't have a one to one mapping about what
> driver supports what tuner (nor we wanted to do it, as this would
> mean lots of work for not much gain).

Ok

> > The definition
> > of the VIDEO_TUNER symbol is an empty 'tristate' symbol with a
> > dependency on MEDIA_TUNER to ensure we get a warning if MEDIA_TUNER
> > is not enabled, and to ensure it is set to 'm' if MEDIA_TUNER=m and
> > a "bool" driver selects VIDEO_TUNER.
> 
> No, VIDEO_TUNER is there because we wanted to be able to use select
> to enable V4L2 tuner core support and let people to manually select
> the needed I2C devices with MEDIA_SUBDRV_AUTOSELECT unselected.

I meant what the dependency is there for, not the symbol itself.
It's clear what the symbol does.

> > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > index 9beece00869b..1050bdf1848f 100644
> > --- a/drivers/media/v4l2-core/Kconfig
> > +++ b/drivers/media/v4l2-core/Kconfig
> > @@ -37,7 +37,11 @@ config VIDEO_PCI_SKELETON
> >  # Used by drivers that need tuner.ko
> >  config VIDEO_TUNER
> >  	tristate
> > -	depends on MEDIA_TUNER
> > +
> > +config VIDEO_TUNER_MODULE
> > +	tristate # must not be built-in if MEDIA_TUNER=m because of I2C
> > +	default y if VIDEO_TUNER=y || MEDIA_TUNER=y
> > +	default m if VIDEO_TUNER=m
> 
> Doesn't need to worry about that, because all drivers that select VIDEO_TUNER
> depend on I2C:
> 

Ok, then the dependency does not do anything other than generate a
warning.

> diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> index 9beece00869b..b30e1c879a57 100644
> --- a/drivers/media/v4l2-core/Kconfig
> +++ b/drivers/media/v4l2-core/Kconfig
> @@ -37,7 +37,7 @@ config VIDEO_PCI_SKELETON
>  # Used by drivers that need tuner.ko
>  config VIDEO_TUNER
>  	tristate
> -	depends on MEDIA_TUNER
> +	default MEDIA_TUNER
>  
>  # Used by drivers that need v4l2-mem2mem.ko
>  config V4L2_MEM2MEM_DEV

So this means it's now enabled if MEDIA_TUNER is enabled, whereas
before it was only enabled when explicitly selected. That sounds
like a useful change, but it also seems unrelated to the warning
fix, and should probably be a separate change, while for now
we can simply remove the 'depends on' line without any replacement.

> Ok, if we'll have platform drivers for analog TV using the I2C bus
> at directly in SoC, then your solution is better, but the tuner core
> driver may not be the best way of doing it. So, for now, I would use
> the simpler version.

Ok. Do you want me to submit a new version or do you prefer to write
one yourself? With or without the 'default'?

	Arnd

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

* Re: [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
  2016-01-26 16:51           ` Arnd Bergmann
@ 2016-01-26 17:08             ` Mauro Carvalho Chehab
  -1 siblings, 0 replies; 36+ messages in thread
From: Mauro Carvalho Chehab @ 2016-01-26 17:08 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arm-kernel, Hans Verkuil, linux-media, linux-kernel

Em Tue, 26 Jan 2016 17:51:11 +0100
Arnd Bergmann <arnd@arndb.de> escreveu:

> On Tuesday 26 January 2016 14:36:44 Mauro Carvalho Chehab wrote:
> > Em Tue, 26 Jan 2016 16:53:38 +0100
> > Arnd Bergmann <arnd@arndb.de> escreveu:  
> > > On Tuesday 26 January 2016 12:33:08 Mauro Carvalho Chehab wrote:  
> > > > Em Tue, 26 Jan 2016 15:10:00 +0100
> > > > Advanced users may, instead, manually select the media tuner that his
> > > > hardware needs. In such case, it doesn't matter if MEDIA_TUNER
> > > > is enabled or not.
> > > > 
> > > > As this is due to a Kconfig limitation, I've no idea how to fix or get
> > > > hid of it, but making em28xx dependent of MEDIA_TUNER is wrong.    
> > > 
> > > I don't understand what limitation you see here.   
> > 
> > Before MEDIA_TUNER, what we had was something like:
> > 
> > 	config MEDIA_driver_foo
> > 	select VIDEO_tuner_bar if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_frontend_foobar if MEDIA_SUBDRV_AUTOSELECT
> > 	...
> > 
> > However, as different I2C drivers had different dependencies, this
> > used to cause lots of troubles. So, one of the Kbuild maintainers
> > came out with the idea of converting from select into depends on.
> > The MEDIA_TUNER is just an ancillary invisible option to make it
> > work at the tuner's side, as usually what we want is to have all
> > tuners selected, as we don't have a one to one mapping about what
> > driver supports what tuner (nor we wanted to do it, as this would
> > mean lots of work for not much gain).  
> 
> Ok
> 
> > > The definition
> > > of the VIDEO_TUNER symbol is an empty 'tristate' symbol with a
> > > dependency on MEDIA_TUNER to ensure we get a warning if MEDIA_TUNER
> > > is not enabled, and to ensure it is set to 'm' if MEDIA_TUNER=m and
> > > a "bool" driver selects VIDEO_TUNER.  
> > 
> > No, VIDEO_TUNER is there because we wanted to be able to use select
> > to enable V4L2 tuner core support and let people to manually select
> > the needed I2C devices with MEDIA_SUBDRV_AUTOSELECT unselected.  
> 
> I meant what the dependency is there for, not the symbol itself.
> It's clear what the symbol does.
> 
> > > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > > index 9beece00869b..1050bdf1848f 100644
> > > --- a/drivers/media/v4l2-core/Kconfig
> > > +++ b/drivers/media/v4l2-core/Kconfig
> > > @@ -37,7 +37,11 @@ config VIDEO_PCI_SKELETON
> > >  # Used by drivers that need tuner.ko
> > >  config VIDEO_TUNER
> > >  	tristate
> > > -	depends on MEDIA_TUNER
> > > +
> > > +config VIDEO_TUNER_MODULE
> > > +	tristate # must not be built-in if MEDIA_TUNER=m because of I2C
> > > +	default y if VIDEO_TUNER=y || MEDIA_TUNER=y
> > > +	default m if VIDEO_TUNER=m  
> > 
> > Doesn't need to worry about that, because all drivers that select VIDEO_TUNER
> > depend on I2C:
> >   
> 
> Ok, then the dependency does not do anything other than generate a
> warning.
> 
> > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > index 9beece00869b..b30e1c879a57 100644
> > --- a/drivers/media/v4l2-core/Kconfig
> > +++ b/drivers/media/v4l2-core/Kconfig
> > @@ -37,7 +37,7 @@ config VIDEO_PCI_SKELETON
> >  # Used by drivers that need tuner.ko
> >  config VIDEO_TUNER
> >  	tristate
> > -	depends on MEDIA_TUNER
> > +	default MEDIA_TUNER
> >  
> >  # Used by drivers that need v4l2-mem2mem.ko
> >  config V4L2_MEM2MEM_DEV  
> 
> So this means it's now enabled if MEDIA_TUNER is enabled, whereas
> before it was only enabled when explicitly selected. That sounds
> like a useful change, but it also seems unrelated to the warning
> fix, and should probably be a separate change, while for now
> we can simply remove the 'depends on' line without any replacement.

True.

> > Ok, if we'll have platform drivers for analog TV using the I2C bus
> > at directly in SoC, then your solution is better, but the tuner core
> > driver may not be the best way of doing it. So, for now, I would use
> > the simpler version.  
> 
> Ok. Do you want me to submit a new version or do you prefer to write
> one yourself? With or without the 'default'?

Feel free to submit a new version without the default.

Thanks!
Mauro

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

* [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
@ 2016-01-26 17:08             ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 36+ messages in thread
From: Mauro Carvalho Chehab @ 2016-01-26 17:08 UTC (permalink / raw)
  To: linux-arm-kernel

Em Tue, 26 Jan 2016 17:51:11 +0100
Arnd Bergmann <arnd@arndb.de> escreveu:

> On Tuesday 26 January 2016 14:36:44 Mauro Carvalho Chehab wrote:
> > Em Tue, 26 Jan 2016 16:53:38 +0100
> > Arnd Bergmann <arnd@arndb.de> escreveu:  
> > > On Tuesday 26 January 2016 12:33:08 Mauro Carvalho Chehab wrote:  
> > > > Em Tue, 26 Jan 2016 15:10:00 +0100
> > > > Advanced users may, instead, manually select the media tuner that his
> > > > hardware needs. In such case, it doesn't matter if MEDIA_TUNER
> > > > is enabled or not.
> > > > 
> > > > As this is due to a Kconfig limitation, I've no idea how to fix or get
> > > > hid of it, but making em28xx dependent of MEDIA_TUNER is wrong.    
> > > 
> > > I don't understand what limitation you see here.   
> > 
> > Before MEDIA_TUNER, what we had was something like:
> > 
> > 	config MEDIA_driver_foo
> > 	select VIDEO_tuner_bar if MEDIA_SUBDRV_AUTOSELECT
> > 	select MEDIA_frontend_foobar if MEDIA_SUBDRV_AUTOSELECT
> > 	...
> > 
> > However, as different I2C drivers had different dependencies, this
> > used to cause lots of troubles. So, one of the Kbuild maintainers
> > came out with the idea of converting from select into depends on.
> > The MEDIA_TUNER is just an ancillary invisible option to make it
> > work at the tuner's side, as usually what we want is to have all
> > tuners selected, as we don't have a one to one mapping about what
> > driver supports what tuner (nor we wanted to do it, as this would
> > mean lots of work for not much gain).  
> 
> Ok
> 
> > > The definition
> > > of the VIDEO_TUNER symbol is an empty 'tristate' symbol with a
> > > dependency on MEDIA_TUNER to ensure we get a warning if MEDIA_TUNER
> > > is not enabled, and to ensure it is set to 'm' if MEDIA_TUNER=m and
> > > a "bool" driver selects VIDEO_TUNER.  
> > 
> > No, VIDEO_TUNER is there because we wanted to be able to use select
> > to enable V4L2 tuner core support and let people to manually select
> > the needed I2C devices with MEDIA_SUBDRV_AUTOSELECT unselected.  
> 
> I meant what the dependency is there for, not the symbol itself.
> It's clear what the symbol does.
> 
> > > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > > index 9beece00869b..1050bdf1848f 100644
> > > --- a/drivers/media/v4l2-core/Kconfig
> > > +++ b/drivers/media/v4l2-core/Kconfig
> > > @@ -37,7 +37,11 @@ config VIDEO_PCI_SKELETON
> > >  # Used by drivers that need tuner.ko
> > >  config VIDEO_TUNER
> > >  	tristate
> > > -	depends on MEDIA_TUNER
> > > +
> > > +config VIDEO_TUNER_MODULE
> > > +	tristate # must not be built-in if MEDIA_TUNER=m because of I2C
> > > +	default y if VIDEO_TUNER=y || MEDIA_TUNER=y
> > > +	default m if VIDEO_TUNER=m  
> > 
> > Doesn't need to worry about that, because all drivers that select VIDEO_TUNER
> > depend on I2C:
> >   
> 
> Ok, then the dependency does not do anything other than generate a
> warning.
> 
> > diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig
> > index 9beece00869b..b30e1c879a57 100644
> > --- a/drivers/media/v4l2-core/Kconfig
> > +++ b/drivers/media/v4l2-core/Kconfig
> > @@ -37,7 +37,7 @@ config VIDEO_PCI_SKELETON
> >  # Used by drivers that need tuner.ko
> >  config VIDEO_TUNER
> >  	tristate
> > -	depends on MEDIA_TUNER
> > +	default MEDIA_TUNER
> >  
> >  # Used by drivers that need v4l2-mem2mem.ko
> >  config V4L2_MEM2MEM_DEV  
> 
> So this means it's now enabled if MEDIA_TUNER is enabled, whereas
> before it was only enabled when explicitly selected. That sounds
> like a useful change, but it also seems unrelated to the warning
> fix, and should probably be a separate change, while for now
> we can simply remove the 'depends on' line without any replacement.

True.

> > Ok, if we'll have platform drivers for analog TV using the I2C bus
> > at directly in SoC, then your solution is better, but the tuner core
> > driver may not be the best way of doing it. So, for now, I would use
> > the simpler version.  
> 
> Ok. Do you want me to submit a new version or do you prefer to write
> one yourself? With or without the 'default'?

Feel free to submit a new version without the default.

Thanks!
Mauro

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

* Re: [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
  2016-01-26 17:08             ` Mauro Carvalho Chehab
@ 2016-01-26 22:01               ` Arnd Bergmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 22:01 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Mauro Carvalho Chehab, Hans Verkuil, linux-kernel, linux-media

On Tuesday 26 January 2016 15:08:19 Mauro Carvalho Chehab wrote:
> > > Ok, if we'll have platform drivers for analog TV using the I2C bus
> > > at directly in SoC, then your solution is better, but the tuner core
> > > driver may not be the best way of doing it. So, for now, I would use
> > > the simpler version.  
> > 
> > Ok. Do you want me to submit a new version or do you prefer to write
> > one yourself? With or without the 'default'?
> 
> Feel free to submit a new version without the default.
> 
> 

Ok, done.

	Arnd

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

* [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency
@ 2016-01-26 22:01               ` Arnd Bergmann
  0 siblings, 0 replies; 36+ messages in thread
From: Arnd Bergmann @ 2016-01-26 22:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 26 January 2016 15:08:19 Mauro Carvalho Chehab wrote:
> > > Ok, if we'll have platform drivers for analog TV using the I2C bus
> > > at directly in SoC, then your solution is better, but the tuner core
> > > driver may not be the best way of doing it. So, for now, I would use
> > > the simpler version.  
> > 
> > Ok. Do you want me to submit a new version or do you prefer to write
> > one yourself? With or without the 'default'?
> 
> Feel free to submit a new version without the default.
> 
> 

Ok, done.

	Arnd

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

* Re: [3/7,media] gspca: avoid unused variable warnings
  2016-01-26 14:09   ` Arnd Bergmann
@ 2016-07-03 21:22     ` Hans de Goede
  -1 siblings, 0 replies; 36+ messages in thread
From: Hans de Goede @ 2016-07-03 21:22 UTC (permalink / raw)
  To: Arnd Bergmann, Mauro Carvalho Chehab
  Cc: linux-arm-kernel, Hans Verkuil, Leandro Costantino, linux-media,
	linux-kernel

Hi Arnd,

On 26-01-16 15:09, Arnd Bergmann wrote:
> When CONFIG_INPUT is disabled, multiple gspca backend drivers
> print compile-time warnings about unused variables:
>
> media/usb/gspca/cpia1.c: In function 'sd_stopN':
> media/usb/gspca/cpia1.c:1627:13: error: unused variable 'sd' [-Werror=unused-variable]
> media/usb/gspca/konica.c: In function 'sd_stopN':
> media/usb/gspca/konica.c:246:13: error: unused variable 'sd' [-Werror=unused-variable]
>
> This encloses the declarations in #ifdef CONFIG_INPUT, just like
> the code using them is.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: ee186fd96a5f ("[media] gscpa_t613: Add support for the camera button")
> Fixes: c2f644aeeba3 ("[media] gspca_cpia1: Add support for button")
> Fixes: b517af722860 ("V4L/DVB: gspca_konica: New gspca subdriver for konica chipset using cams")

Sorry for being super slow to respond to this patch, can you
please do a new version using __maybe_unused instead of adding
#ifdef-s ?

Thanks,

Hans


> ---
>  drivers/media/usb/gspca/cpia1.c  | 2 ++
>  drivers/media/usb/gspca/konica.c | 2 ++
>  drivers/media/usb/gspca/t613.c   | 3 ++-
>  3 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c
> index f23df4a9d8c5..e2264dc5d64d 100644
> --- a/drivers/media/usb/gspca/cpia1.c
> +++ b/drivers/media/usb/gspca/cpia1.c
> @@ -1624,7 +1624,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
>
>  static void sd_stopN(struct gspca_dev *gspca_dev)
>  {
> +#if IS_ENABLED(CONFIG_INPUT)
>  	struct sd *sd = (struct sd *) gspca_dev;
> +#endif
>
>  	command_pause(gspca_dev);
>
> diff --git a/drivers/media/usb/gspca/konica.c b/drivers/media/usb/gspca/konica.c
> index 39c96bb4c985..21c52655ef28 100644
> --- a/drivers/media/usb/gspca/konica.c
> +++ b/drivers/media/usb/gspca/konica.c
> @@ -243,7 +243,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
>
>  static void sd_stopN(struct gspca_dev *gspca_dev)
>  {
> +#if IS_ENABLED(CONFIG_INPUT)
>  	struct sd *sd = (struct sd *) gspca_dev;
> +#endif
>
>  	konica_stream_off(gspca_dev);
>  #if IS_ENABLED(CONFIG_INPUT)
> diff --git a/drivers/media/usb/gspca/t613.c b/drivers/media/usb/gspca/t613.c
> index e2cc4e5a0ccb..d918c2d31502 100644
> --- a/drivers/media/usb/gspca/t613.c
> +++ b/drivers/media/usb/gspca/t613.c
> @@ -837,11 +837,12 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
>  			u8 *data,			/* isoc packet */
>  			int len)			/* iso packet length */
>  {
> -	struct sd *sd = (struct sd *) gspca_dev;
>  	int pkt_type;
>
>  	if (data[0] == 0x5a) {
>  #if IS_ENABLED(CONFIG_INPUT)
> +		struct sd *sd = (struct sd *) gspca_dev;
> +
>  		if (len > 20) {
>  			u8 state = (data[20] & 0x80) ? 1 : 0;
>  			if (sd->button_pressed != state) {
>

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

* [3/7,media] gspca: avoid unused variable warnings
@ 2016-07-03 21:22     ` Hans de Goede
  0 siblings, 0 replies; 36+ messages in thread
From: Hans de Goede @ 2016-07-03 21:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

On 26-01-16 15:09, Arnd Bergmann wrote:
> When CONFIG_INPUT is disabled, multiple gspca backend drivers
> print compile-time warnings about unused variables:
>
> media/usb/gspca/cpia1.c: In function 'sd_stopN':
> media/usb/gspca/cpia1.c:1627:13: error: unused variable 'sd' [-Werror=unused-variable]
> media/usb/gspca/konica.c: In function 'sd_stopN':
> media/usb/gspca/konica.c:246:13: error: unused variable 'sd' [-Werror=unused-variable]
>
> This encloses the declarations in #ifdef CONFIG_INPUT, just like
> the code using them is.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: ee186fd96a5f ("[media] gscpa_t613: Add support for the camera button")
> Fixes: c2f644aeeba3 ("[media] gspca_cpia1: Add support for button")
> Fixes: b517af722860 ("V4L/DVB: gspca_konica: New gspca subdriver for konica chipset using cams")

Sorry for being super slow to respond to this patch, can you
please do a new version using __maybe_unused instead of adding
#ifdef-s ?

Thanks,

Hans


> ---
>  drivers/media/usb/gspca/cpia1.c  | 2 ++
>  drivers/media/usb/gspca/konica.c | 2 ++
>  drivers/media/usb/gspca/t613.c   | 3 ++-
>  3 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c
> index f23df4a9d8c5..e2264dc5d64d 100644
> --- a/drivers/media/usb/gspca/cpia1.c
> +++ b/drivers/media/usb/gspca/cpia1.c
> @@ -1624,7 +1624,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
>
>  static void sd_stopN(struct gspca_dev *gspca_dev)
>  {
> +#if IS_ENABLED(CONFIG_INPUT)
>  	struct sd *sd = (struct sd *) gspca_dev;
> +#endif
>
>  	command_pause(gspca_dev);
>
> diff --git a/drivers/media/usb/gspca/konica.c b/drivers/media/usb/gspca/konica.c
> index 39c96bb4c985..21c52655ef28 100644
> --- a/drivers/media/usb/gspca/konica.c
> +++ b/drivers/media/usb/gspca/konica.c
> @@ -243,7 +243,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
>
>  static void sd_stopN(struct gspca_dev *gspca_dev)
>  {
> +#if IS_ENABLED(CONFIG_INPUT)
>  	struct sd *sd = (struct sd *) gspca_dev;
> +#endif
>
>  	konica_stream_off(gspca_dev);
>  #if IS_ENABLED(CONFIG_INPUT)
> diff --git a/drivers/media/usb/gspca/t613.c b/drivers/media/usb/gspca/t613.c
> index e2cc4e5a0ccb..d918c2d31502 100644
> --- a/drivers/media/usb/gspca/t613.c
> +++ b/drivers/media/usb/gspca/t613.c
> @@ -837,11 +837,12 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
>  			u8 *data,			/* isoc packet */
>  			int len)			/* iso packet length */
>  {
> -	struct sd *sd = (struct sd *) gspca_dev;
>  	int pkt_type;
>
>  	if (data[0] == 0x5a) {
>  #if IS_ENABLED(CONFIG_INPUT)
> +		struct sd *sd = (struct sd *) gspca_dev;
> +
>  		if (len > 20) {
>  			u8 state = (data[20] & 0x80) ? 1 : 0;
>  			if (sd->button_pressed != state) {
>

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

end of thread, other threads:[~2016-07-03 21:23 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-26 14:09 [PATCH 1/7] [media] pwc: hide unused label Arnd Bergmann
2016-01-26 14:09 ` Arnd Bergmann
2016-01-26 14:09 ` [PATCH 2/7] [media] hdpvr: hide unused variable Arnd Bergmann
2016-01-26 14:09   ` Arnd Bergmann
2016-01-26 14:09 ` [PATCH 3/7] [media] gspca: avoid unused variable warnings Arnd Bergmann
2016-01-26 14:09   ` Arnd Bergmann
2016-07-03 21:22   ` [3/7,media] " Hans de Goede
2016-07-03 21:22     ` Hans de Goede
2016-01-26 14:09 ` [PATCH 4/7] [media] b2c2: flexcop: avoid unused function warnings Arnd Bergmann
2016-01-26 14:09   ` Arnd Bergmann
2016-01-26 14:09 ` [PATCH 5/7] [media] em28xx: only use mt9v011 if camera support is enabled Arnd Bergmann
2016-01-26 14:09   ` Arnd Bergmann
2016-01-26 14:10 ` [PATCH 6/7] [media] em28xx: add MEDIA_TUNER dependency Arnd Bergmann
2016-01-26 14:10   ` Arnd Bergmann
2016-01-26 14:33   ` Mauro Carvalho Chehab
2016-01-26 14:33     ` Mauro Carvalho Chehab
2016-01-26 15:53     ` Arnd Bergmann
2016-01-26 15:53       ` Arnd Bergmann
2016-01-26 16:36       ` Mauro Carvalho Chehab
2016-01-26 16:36         ` Mauro Carvalho Chehab
2016-01-26 16:51         ` Arnd Bergmann
2016-01-26 16:51           ` Arnd Bergmann
2016-01-26 17:08           ` Mauro Carvalho Chehab
2016-01-26 17:08             ` Mauro Carvalho Chehab
2016-01-26 22:01             ` Arnd Bergmann
2016-01-26 22:01               ` Arnd Bergmann
2016-01-26 14:10 ` [PATCH 7/7] [media] go7007: add MEDIA_CAMERA_SUPPORT dependency Arnd Bergmann
2016-01-26 14:10   ` Arnd Bergmann
2016-01-26 15:04   ` Mauro Carvalho Chehab
2016-01-26 15:04     ` Mauro Carvalho Chehab
2016-01-26 15:41     ` Mauro Carvalho Chehab
2016-01-26 15:41       ` Mauro Carvalho Chehab
2016-01-26 14:40 ` [PATCH 1/7] [media] pwc: hide unused label kbuild test robot
2016-01-26 14:40   ` kbuild test robot
2016-01-26 15:29 ` Arnd Bergmann
2016-01-26 15:29   ` 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.