Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

video: fbdev-OMAP2: Deletion of unnecessary checks before the function call "i2c_put_adapter"

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>

authored by

Markus Elfring and committed by
Tomi Valkeinen
bc500d6e 6049a7a2

+3 -6
+3 -6
drivers/video/fbdev/omap2/displays-new/connector-dvi.c
··· 262 262 263 263 in = omap_dss_find_output(pdata->source); 264 264 if (in == NULL) { 265 - if (ddata->i2c_adapter) 266 - i2c_put_adapter(ddata->i2c_adapter); 265 + i2c_put_adapter(ddata->i2c_adapter); 267 266 268 267 dev_err(&pdev->dev, "Failed to find video source\n"); 269 268 return -EPROBE_DEFER; ··· 351 352 err_reg: 352 353 omap_dss_put_device(ddata->in); 353 354 354 - if (ddata->i2c_adapter) 355 - i2c_put_adapter(ddata->i2c_adapter); 355 + i2c_put_adapter(ddata->i2c_adapter); 356 356 357 357 return r; 358 358 } ··· 369 371 370 372 omap_dss_put_device(in); 371 373 372 - if (ddata->i2c_adapter) 373 - i2c_put_adapter(ddata->i2c_adapter); 374 + i2c_put_adapter(ddata->i2c_adapter); 374 375 375 376 return 0; 376 377 }