mfd: wcd934x: Fix an error handling path in wcd934x_slim_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 20 May 2023 07:10:54 +0000 (09:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:21:56 +0000 (16:21 +0200)
commit2e8ab6846063eef192e4ca736d14cbda36550150
tree48484c2067b24833838fea55496dfd769def1911
parent7a37abf096c255131293e9d5db1de44277e82f6d
mfd: wcd934x: Fix an error handling path in wcd934x_slim_probe()

[ Upstream commit f190b4891a3f9fac123a7afd378d4143a2723313 ]

If devm_gpiod_get_optional() fails, some resources need to be released, as
already done in the .remove() function.

While at it, remove the unneeded error code from a dev_err_probe() call.
It is already added in a human readable way by dev_err_probe() itself.

Fixes: 6a0ee2a61a31 ("mfd: wcd934x: Replace legacy gpio interface for gpiod")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/02d8447f6d1df52cc8357aae698152e9a9be67c6.1684565021.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/wcd934x.c