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)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 19:38:28 +0000 (15:38 -0400)
commitae7a9734da91c3fd1405f3ae74a45be5f5140631
tree5861218bfddeac32ae77524d6b079f92968efeab
parentbda938df8ac95f80445a483e170c1aa0bab2c680
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