[media] tuners: remove uneeded checks before release_firmware()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 30 Nov 2014 18:05:48 +0000 (15:05 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 4 Dec 2014 17:28:51 +0000 (15:28 -0200)
The release_firmware() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/tuners/si2157.c
drivers/media/tuners/xc5000.c

index 8e57696..e17ab1f 100644 (file)
@@ -196,8 +196,7 @@ warm:
        return 0;
 
 err:
-       if (fw)
-               release_firmware(fw);
+       release_firmware(fw);
 
        dev_dbg(&s->client->dev, "failed=%d\n", ret);
        return ret;
index 705c258..2a039de 100644 (file)
@@ -1336,8 +1336,7 @@ static int xc5000_release(struct dvb_frontend *fe)
 
        if (priv) {
                cancel_delayed_work(&priv->timer_sleep);
-               if (priv->firmware)
-                       release_firmware(priv->firmware);
+               release_firmware(priv->firmware);
                hybrid_tuner_release_state(priv);
        }