[1/2] media: i2c: adv7511-v4l2: drop check because i2c_unregister_device() is NULL safe
diff mbox series

Message ID 20190820153441.7748-1-wsa+renesas@sang-engineering.com
State Awaiting Upstream
Headers show
Series
  • [1/2] media: i2c: adv7511-v4l2: drop check because i2c_unregister_device() is NULL safe
Related show

Commit Message

Wolfram Sang Aug. 20, 2019, 3:34 p.m. UTC
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>
---
Build tested only, buildbot is happy, too.

Please apply to your tree.

 drivers/media/i2c/adv7511-v4l2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/drivers/media/i2c/adv7511-v4l2.c b/drivers/media/i2c/adv7511-v4l2.c
index 7db94267bcab..55b3a9c12e43 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);