[media] si2157: simplify si2157_cmd_execute() error path
authorAntti Palosaari <crope@iki.fi>
Sat, 6 Dec 2014 17:04:05 +0000 (14:04 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 29 Jan 2015 20:47:45 +0000 (18:47 -0200)
Remove if () from firmware command error path as there should not be
any error prone conditional logic there. Use goto labels instead.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/tuners/si2157.c

index 14d2f73631498db3e31235b3d274ba7dcfc9e6bb..f7c38678f8054882ed0c163660023b6697964b8e 100644 (file)
@@ -65,15 +65,11 @@ static int si2157_cmd_execute(struct si2157_dev *dev, struct si2157_cmd *cmd)
                }
        }
 
-       ret = 0;
+       mutex_unlock(&dev->i2c_mutex);
+       return 0;
 
 err_mutex_unlock:
        mutex_unlock(&dev->i2c_mutex);
-       if (ret)
-               goto err;
-
-       return 0;
-err:
        dev_dbg(&dev->client->dev, "failed=%d\n", ret);
        return ret;
 }