summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-09 13:46:05 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-10 08:03:29 -0200
commit82e92f4cad6e0c42f8dbe7497b39dec7b3eb7b11 (patch)
tree65f62e0eaf98fb2649f8b72f760c0a6ccd7cc26d
parentac90aa02d5b9a9bde6bcd9ac3ee181a4d212d355 (diff)
downloadop-kernel-dev-82e92f4cad6e0c42f8dbe7497b39dec7b3eb7b11.zip
op-kernel-dev-82e92f4cad6e0c42f8dbe7497b39dec7b3eb7b11.tar.gz
[media] au0828: only create V4L2 graph if V4L2 is registered
It doesn't make sense to try to create the analog TV graph, if the device fails to register at V4L2, or if it doesn't have V4L2 support. Thanks to Shuah for pointing this issue. Reported-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/usb/au0828/au0828-core.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index df2bc3f..0a8afbf 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -419,8 +419,21 @@ static int au0828_usb_probe(struct usb_interface *interface,
#ifdef CONFIG_VIDEO_AU0828_V4L2
/* Analog TV */
- if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED)
- au0828_analog_register(dev, interface);
+ if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED) {
+ retval = au0828_analog_register(dev, interface);
+ if (retval) {
+ pr_err("%s() au0282_dev_register failed to register on V4L2\n",
+ __func__);
+ goto done;
+ }
+
+ retval = au0828_create_media_graph(dev);
+ if (retval) {
+ pr_err("%s() au0282_dev_register failed to create graph\n",
+ __func__);
+ goto done;
+ }
+ }
#endif
/* Digital TV */
@@ -443,13 +456,6 @@ static int au0828_usb_probe(struct usb_interface *interface,
mutex_unlock(&dev->lock);
- retval = au0828_create_media_graph(dev);
- if (retval) {
- pr_err("%s() au0282_dev_register failed to create graph\n",
- __func__);
- goto done;
- }
-
#ifdef CONFIG_MEDIA_CONTROLLER
retval = media_device_register(dev->media_dev);
#endif
OpenPOWER on IntegriCloud