[media] cx231xx: prints error code if can't switch TV mode
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 4 Sep 2016 13:08:17 +0000 (10:08 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 5 Sep 2016 18:26:33 +0000 (15:26 -0300)
If something bad happens when switching between digital
and analog mode, prints an error and outputs the returned code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/cx231xx/cx231xx-core.c

index 97730cb2f591d06e555acf3be23f64efa780c579..59b72264a0bff2d21e6ff46b4f66d600df86e5b2 100644 (file)
@@ -746,7 +746,14 @@ int cx231xx_set_mode(struct cx231xx *dev, enum cx231xx_mode set_mode)
                }
        }
 
-       return errCode ? -EINVAL : 0;
+       if (errCode < 0) {
+               dev_err(dev->dev, "Failed to set devmode to %s: error: %i",
+                       dev->mode == CX231XX_DIGITAL_MODE ? "digital" : "analog",
+                       errCode);
+               return errCode;
+       }
+
+       return 0;
 }
 EXPORT_SYMBOL_GPL(cx231xx_set_mode);