[media] saa7164: better handle error codes
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 18 May 2017 11:55:41 +0000 (08:55 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 19 May 2017 10:08:05 +0000 (07:08 -0300)
Right now, the driver is doing the right thing for
PVC_ERRORCODE_UNKNOWN and PVC_ERRORCODE_INVALID_CONTROL:
for both, it returns an error code (SAA_ERR_NOT_SUPPORTED).

However, it is printing two error messages instead of one
on those cases.

Fix the logic.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/saa7164/saa7164-cmd.c

index 175015ca79f2057ef75d802cd9c76130d4ffa759..dfebd77ada59d9666ecb6e5d65b7b29bb5683c86 100644 (file)
@@ -506,6 +506,8 @@ int saa7164_cmd_send(struct saa7164_dev *dev, u8 id, enum tmComResCmd command,
                                dprintk(DBGLVL_CMD,
                                        "%s() UNKNOWN OR INVALID CONTROL\n",
                                        __func__);
+                               ret = SAA_ERR_NOT_SUPPORTED;
+                               break;
                        default:
                                dprintk(DBGLVL_CMD, "%s() UNKNOWN\n", __func__);
                                ret = SAA_ERR_NOT_SUPPORTED;