]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:29:28 +0000 (16:29 +0200)
commita3552e2f7d30d27ec95b6a009526934f5a37e0b9
tree2f921d8b028f2addd931668aec9a6dcf53daf147
parent85427d5109c24a79db9239a7665896a4458edbeb
pinctrl: ti: ti-iodelay: Fix some error handling paths

[ Upstream commit a9f2b249adeef2b9744a884355fa8f5e581d507f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/ti/pinctrl-ti-iodelay.c