diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2019-08-20 12:34:40 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-08-26 10:44:16 -0300 |
commit | 086c51e2405e75bb5a7575e3bdc784ae14c8a4e6 (patch) | |
tree | fb0d63ca5a7e05b7cdaf25187c31743142aea44a /drivers/media | |
parent | eb0a6fb25c05679d32698c2503ee39bdbbc13663 (diff) | |
download | linux-086c51e2405e75bb5a7575e3bdc784ae14c8a4e6.tar.bz2 |
media: i2c: adv7511-v4l2: drop check because i2c_unregister_device() is NULL safe
No need to check the argument of i2c_unregister_device() because the
function itself does it.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/i2c/adv7511-v4l2.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/i2c/adv7511-v4l2.c b/drivers/media/i2c/adv7511-v4l2.c index 3b3966cdf594..62763ec4cd07 100644 --- a/drivers/media/i2c/adv7511-v4l2.c +++ b/drivers/media/i2c/adv7511-v4l2.c @@ -1940,8 +1940,7 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id * err_unreg_pktmem: i2c_unregister_device(state->i2c_pktmem); err_unreg_cec: - if (state->i2c_cec) - i2c_unregister_device(state->i2c_cec); + i2c_unregister_device(state->i2c_cec); err_unreg_edid: i2c_unregister_device(state->i2c_edid); err_entity: @@ -1967,8 +1966,7 @@ static int adv7511_remove(struct i2c_client *client) adv7511_init_setup(sd); cancel_delayed_work(&state->edid_handler); i2c_unregister_device(state->i2c_edid); - if (state->i2c_cec) - i2c_unregister_device(state->i2c_cec); + i2c_unregister_device(state->i2c_cec); i2c_unregister_device(state->i2c_pktmem); destroy_workqueue(state->work_queue); v4l2_device_unregister_subdev(sd); |