Commit 297aca18 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mauro Carvalho Chehab

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 85f42985
...@@ -1366,11 +1366,9 @@ static int adv7180_probe(struct i2c_client *client, ...@@ -1366,11 +1366,9 @@ static int adv7180_probe(struct i2c_client *client,
err_free_ctrl: err_free_ctrl:
adv7180_exit_controls(state); adv7180_exit_controls(state);
err_unregister_vpp_client: 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: 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); mutex_destroy(&state->mutex);
return ret; return ret;
} }
...@@ -1388,10 +1386,8 @@ static int adv7180_remove(struct i2c_client *client) ...@@ -1388,10 +1386,8 @@ static int adv7180_remove(struct i2c_client *client)
media_entity_cleanup(&sd->entity); media_entity_cleanup(&sd->entity);
adv7180_exit_controls(state); adv7180_exit_controls(state);
if (state->chip_info->flags & ADV7180_FLAG_I2P) i2c_unregister_device(state->vpp_client);
i2c_unregister_device(state->vpp_client); i2c_unregister_device(state->csi_client);
if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
i2c_unregister_device(state->csi_client);
adv7180_set_power_pin(state, false); adv7180_set_power_pin(state, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment