extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 10 May 2020 09:53:03 +0000 (11:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:49:00 +0000 (17:49 +0200)
commit834d4dd15395d6b022baad9211483ccfc99ec4cf
tree8661556a8df8ffb3ce354fd19336c23d82082098
parente993b8a59cc284caebf8dc281182dc6b642315ba
extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()'

[ Upstream commit bc84cff2c92ae5ccb2c37da73756e7174b1b430f ]

In some error handling paths, a call to 'iio_channel_get()' is not balanced
by a corresponding call to 'iio_channel_release()'.

This can be achieved easily by using the devm_ variant of
'iio_channel_get()'.

This has the extra benefit to simplify the remove function.

Fixes: 19939860dcae ("extcon: adc_jack: adc-jack driver to support 3.5 pi or simliar devices")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/extcon/extcon-adc-jack.c