mfd: lp8788: Fix an error handling path in lp8788_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 31 Jul 2022 09:55:27 +0000 (11:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:17:06 +0000 (13:17 +0200)
commit2a2260033510adfa4fde11ae1f6c47a99ba1384b
treee097ab4400e540b1355b32ec0ec71c4e571524f1
parentfdf97de9c0065eccd752845f170f87ef1a6f58eb
mfd: lp8788: Fix an error handling path in lp8788_probe()

[ Upstream commit becfdcd75126b20b8ec10066c5e85b34f8994ad5 ]

Should an error occurs in mfd_add_devices(), some resources need to be
released, as already done in the .remove() function.

Add an error handling path and a lp8788_irq_exit() call to undo a previous
lp8788_irq_init().

Fixes: eea6b7cc53aa ("mfd: Add lp8788 mfd driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/18398722da9df9490722d853e4797350189ae79b.1659261275.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/lp8788.c