iio: adc: xilinx-ams: Use devm_delayed_work_autocancel() to simplify code
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 13 Feb 2022 18:29:05 +0000 (19:29 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 26 Feb 2022 16:40:29 +0000 (16:40 +0000)
commit2c43265516b5a507a2bc646453aafea8aaa304e7
treef155831b538412177391ce73834d8b715dfe3c8c
parent2be8795a609800e5071d868d459ce29232fce2c8
iio: adc: xilinx-ams: Use devm_delayed_work_autocancel() to simplify code

Use devm_delayed_work_autocancel() instead of hand writing it. This is
less verbose and saves a few lines of code.

devm_delayed_work_autocancel() uses devm_add_action() instead of
devm_add_action_or_reset(). This is fine, because if the underlying memory
allocation fails, no work has been scheduled yet. So there is nothing to
undo.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/2626e6a057e40cd2271ef0e5f81d12e607bad5b4.1644776929.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/xilinx-ams.c