staging: spmi: hisi-spmi-controller: Fix some error handling paths
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 13 Dec 2020 15:11:05 +0000 (16:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Dec 2020 14:14:53 +0000 (15:14 +0100)
commit12b38ea040b3bb2a30eb9cd488376df5be7ea81f
tree4c7875a39836525f885288a59e2021c0b524dc2c
parent5c8fe583cce542aa0b84adc939ce85293de36e5e
staging: spmi: hisi-spmi-controller: Fix some error handling paths

IN the probe function, if an error occurs after calling
'spmi_controller_alloc()', it must be undone by a corresponding
'spmi_controller_put() call.

In the remove function, use 'spmi_controller_put(ctrl)' instead of
'kfree(ctrl)'.

While a it fix an error message
(s/spmi_add_controller/spmi_controller_add/)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20201213151105.137731-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/hikey9xx/hisi-spmi-controller.c