[media] c8sectpfe: Delete unnecessary checks before two function calls
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 5 Nov 2015 17:55:19 +0000 (15:55 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 19 Nov 2015 12:09:56 +0000 (10:09 -0200)
The functions i2c_put_adapter() and module_put() test whether their
argument is NULL and then return immediately.
Thus the tests around their calls are 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/platform/sti/c8sectpfe/c8sectpfe-common.c

index 95223ab71e1971b05e72ac9686e75a2c2aab7425..07fd6d9ee53ab9e4560573da23e46c49c0b11aab 100644 (file)
@@ -214,12 +214,11 @@ void c8sectpfe_tuner_unregister_frontend(struct c8sectpfe *c8sectpfe,
                        dvb_frontend_detach(tsin->frontend);
                }
 
-               if (tsin && tsin->i2c_adapter)
+               if (tsin)
                        i2c_put_adapter(tsin->i2c_adapter);
 
                if (tsin && tsin->i2c_client) {
-                       if (tsin->i2c_client->dev.driver->owner)
-                               module_put(tsin->i2c_client->dev.driver->owner);
+                       module_put(tsin->i2c_client->dev.driver->owner);
                        i2c_unregister_device(tsin->i2c_client);
                }
        }