]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: i2c: adv7842: Remove redundant cancel_delayed_work in probe
authorDuoming Zhou <duoming@zju.edu.cn>
Tue, 2 Sep 2025 01:10:31 +0000 (09:10 +0800)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 14 Oct 2025 13:07:37 +0000 (15:07 +0200)
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: a89bcd4c6c20 ("[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>
drivers/media/i2c/adv7842.c

index 9780082db8415a3d65860666d0dce8399f57e4e3..331c5171d1ab2baf2d806c3fa7ab38621b0039c6 100644 (file)
@@ -3626,7 +3626,7 @@ static int adv7842_probe(struct i2c_client *client)
        err = media_entity_pads_init(&sd->entity, ADV7842_PAD_SOURCE + 1,
                                     state->pads);
        if (err)
-               goto err_work_queues;
+               goto err_i2c;
 
        err = adv7842_core_init(sd);
        if (err)
@@ -3647,8 +3647,6 @@ static int adv7842_probe(struct i2c_client *client)
 
 err_entity:
        media_entity_cleanup(&sd->entity);
-err_work_queues:
-       cancel_delayed_work(&state->delayed_work_enable_hotplug);
 err_i2c:
        adv7842_unregister_clients(sd);
 err_hdl: