Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: i2c: ADV7604: Remove redundant cancel_delayed_work in probe

The delayed_work delayed_work_enable_hotplug is initialized with
INIT_DELAYED_WORK() in adv76xx_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: 54450f591c99 ("[media] adv7604: driver for the Analog Devices ADV7604 video decoder")
Cc: stable@vger.kernel.org
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Duoming Zhou and committed by
Hans Verkuil
8f34f243 e66a5cc6

+1 -3
+1 -3
drivers/media/i2c/adv7604.c
··· 3670 3670 err = media_entity_pads_init(&sd->entity, state->source_pad + 1, 3671 3671 state->pads); 3672 3672 if (err) 3673 - goto err_work_queues; 3673 + goto err_i2c; 3674 3674 3675 3675 /* Configure regmaps */ 3676 3676 err = configure_regmaps(state); ··· 3711 3711 3712 3712 err_entity: 3713 3713 media_entity_cleanup(&sd->entity); 3714 - err_work_queues: 3715 - cancel_delayed_work(&state->delayed_work_enable_hotplug); 3716 3714 err_i2c: 3717 3715 adv76xx_unregister_clients(state); 3718 3716 err_hdl: