]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl: ti: ti-iodelay: Fix some error handling paths
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 9 Jul 2024 20:37:43 +0000 (22:37 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 5 Aug 2024 07:22:26 +0000 (09:22 +0200)
commita9f2b249adeef2b9744a884355fa8f5e581d507f
tree5ffca51b6a93820e1586293ecfd08ff1ba3ea561
parentbebf833d334249b8ab13446a17d3d47fed6e0d45
pinctrl: ti: ti-iodelay: Fix some error handling paths

In the probe, if an error occurs after the ti_iodelay_pinconf_init_dev()
call, it is likely that ti_iodelay_pinconf_deinit_dev() should be called,
as already done in the remove function.

Also in ti_iodelay_pinconf_init_dev(), if an error occurs after the first
regmap_update_bits() call, it is also likely that the deinit() function
should be called.

The easier way to fix it is to add a devm_add_action_or_reset() at the
rigtht place to have ti_iodelay_pinconf_deinit_dev() called when needed.

Doing so, the .remove() function can be removed, and the associated
platform_set_drvdata() call in the probe as well.

Fixes: 003910ebc83b ("pinctrl: Introduce TI IOdelay configuration driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/0220fa5b925bd08e361be8206a5438f6229deaac.1720556038.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/ti/pinctrl-ti-iodelay.c