Commit b5654c94 authored by Wolfram Sang's avatar Wolfram Sang Committed by Mauro Carvalho Chehab

media: i2c: adv7842: 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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 086c51e2
......@@ -3351,28 +3351,17 @@ static const struct v4l2_ctrl_config adv7842_ctrl_free_run_color = {
static void adv7842_unregister_clients(struct v4l2_subdev *sd)
{
struct adv7842_state *state = to_state(sd);
if (state->i2c_avlink)
i2c_unregister_device(state->i2c_avlink);
if (state->i2c_cec)
i2c_unregister_device(state->i2c_cec);
if (state->i2c_infoframe)
i2c_unregister_device(state->i2c_infoframe);
if (state->i2c_sdp_io)
i2c_unregister_device(state->i2c_sdp_io);
if (state->i2c_sdp)
i2c_unregister_device(state->i2c_sdp);
if (state->i2c_afe)
i2c_unregister_device(state->i2c_afe);
if (state->i2c_repeater)
i2c_unregister_device(state->i2c_repeater);
if (state->i2c_edid)
i2c_unregister_device(state->i2c_edid);
if (state->i2c_hdmi)
i2c_unregister_device(state->i2c_hdmi);
if (state->i2c_cp)
i2c_unregister_device(state->i2c_cp);
if (state->i2c_vdp)
i2c_unregister_device(state->i2c_vdp);
i2c_unregister_device(state->i2c_avlink);
i2c_unregister_device(state->i2c_cec);
i2c_unregister_device(state->i2c_infoframe);
i2c_unregister_device(state->i2c_sdp_io);
i2c_unregister_device(state->i2c_sdp);
i2c_unregister_device(state->i2c_afe);
i2c_unregister_device(state->i2c_repeater);
i2c_unregister_device(state->i2c_edid);
i2c_unregister_device(state->i2c_hdmi);
i2c_unregister_device(state->i2c_cp);
i2c_unregister_device(state->i2c_vdp);
state->i2c_avlink = NULL;
state->i2c_cec = NULL;
......
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