Skip to content

Commit c07fd16

Browse files
stonezdmUlrich Hecht
authored andcommitted
media: i2c: adv7842: Remove redundant cancel_delayed_work in probe
commit e66a5cc606c58e72f18f9cdd868a3672e918f9f8 upstream. The delayed_work delayed_work_enable_hotplug is initialized with INIT_DELAYED_WORK() in adv7842_probe(), but it is never scheduled anywhere in the probe function. Calling cancel_delayed_work() on a work that has never been scheduled is redundant and unnecessary, as there is no pending work to cancel. Remove the redundant cancel_delayed_work() from error handling path and adjust the goto label accordingly to simplify the code and avoid potential confusion. Fixes: a89bcd4 ("[media] adv7842: add new video decoder driver") Cc: stable@vger.kernel.org Signed-off-by: Duoming Zhou <duoming@zju.edu.cn> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent af503ac commit c07fd16

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/media/i2c/adv7842.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3550,7 +3550,7 @@ static int adv7842_probe(struct i2c_client *client,
35503550
state->pad.flags = MEDIA_PAD_FL_SOURCE;
35513551
err = media_entity_pads_init(&sd->entity, 1, &state->pad);
35523552
if (err)
3553-
goto err_work_queues;
3553+
goto err_i2c;
35543554

35553555
err = adv7842_core_init(sd);
35563556
if (err)
@@ -3571,8 +3571,6 @@ static int adv7842_probe(struct i2c_client *client,
35713571

35723572
err_entity:
35733573
media_entity_cleanup(&sd->entity);
3574-
err_work_queues:
3575-
cancel_delayed_work(&state->delayed_work_enable_hotplug);
35763574
err_i2c:
35773575
adv7842_unregister_clients(sd);
35783576
err_hdl:

0 commit comments

Comments
 (0)