]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
video: fbdev-OMAP2: Deletion of unnecessary checks before the function call "i2c_put_...
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 23 Nov 2014 13:07:22 +0000 (14:07 +0100)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 4 Dec 2014 14:16:01 +0000 (16:16 +0200)
The i2c_put_adapter() 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: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/omap2/displays-new/connector-dvi.c

index 2dfb6e5ff0cc135b32055a2fb5e9a8d6abad29c4..3d38e478bc647402f56f395567847bce88da649f 100644 (file)
@@ -262,8 +262,7 @@ static int dvic_probe_pdata(struct platform_device *pdev)
 
        in = omap_dss_find_output(pdata->source);
        if (in == NULL) {
-               if (ddata->i2c_adapter)
-                       i2c_put_adapter(ddata->i2c_adapter);
+               i2c_put_adapter(ddata->i2c_adapter);
 
                dev_err(&pdev->dev, "Failed to find video source\n");
                return -EPROBE_DEFER;
@@ -352,8 +351,7 @@ static int dvic_probe(struct platform_device *pdev)
 err_reg:
        omap_dss_put_device(ddata->in);
 
-       if (ddata->i2c_adapter)
-               i2c_put_adapter(ddata->i2c_adapter);
+       i2c_put_adapter(ddata->i2c_adapter);
 
        return r;
 }
@@ -371,8 +369,7 @@ static int __exit dvic_remove(struct platform_device *pdev)
 
        omap_dss_put_device(in);
 
-       if (ddata->i2c_adapter)
-               i2c_put_adapter(ddata->i2c_adapter);
+       i2c_put_adapter(ddata->i2c_adapter);
 
        return 0;
 }