summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-10-31 17:21:48 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-08 18:12:45 +0300
commit297aca189fdfdf12037e4eebc749aa6ebaa84e0e (patch)
tree38f3b3b40501f8846b46c6a5d89d233517a977c3 /drivers/media
parent85f42985af385f726152fd01836589f0a5a8090e (diff)
downloadlinux-297aca189fdfdf12037e4eebc749aa6ebaa84e0e.tar.xz
media: adv7180: Remove duplicate checks
Since i2c_unregister_device() became NULL-aware we may remove duplicate checks. Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/adv7180.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 6fb818a775db..25d24a3f10a7 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -1366,11 +1366,9 @@ err_media_entity_cleanup:
err_free_ctrl:
adv7180_exit_controls(state);
err_unregister_vpp_client:
- if (state->chip_info->flags & ADV7180_FLAG_I2P)
- i2c_unregister_device(state->vpp_client);
+ i2c_unregister_device(state->vpp_client);
err_unregister_csi_client:
- if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
- i2c_unregister_device(state->csi_client);
+ i2c_unregister_device(state->csi_client);
mutex_destroy(&state->mutex);
return ret;
}
@@ -1388,10 +1386,8 @@ static int adv7180_remove(struct i2c_client *client)
media_entity_cleanup(&sd->entity);
adv7180_exit_controls(state);
- if (state->chip_info->flags & ADV7180_FLAG_I2P)
- i2c_unregister_device(state->vpp_client);
- if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
- i2c_unregister_device(state->csi_client);
+ i2c_unregister_device(state->vpp_client);
+ i2c_unregister_device(state->csi_client);
adv7180_set_power_pin(state, false);