mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()'
[ Upstream commitbc84cff2c9] 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:19939860dc("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>
This commit is contained in:
parent
50aabfa4d8
commit
b74933661c
|
|
@ -128,7 +128,7 @@ static int adc_jack_probe(struct platform_device *pdev)
|
|||
for (i = 0; data->adc_conditions[i].id != EXTCON_NONE; i++);
|
||||
data->num_conditions = i;
|
||||
|
||||
data->chan = iio_channel_get(&pdev->dev, pdata->consumer_channel);
|
||||
data->chan = devm_iio_channel_get(&pdev->dev, pdata->consumer_channel);
|
||||
if (IS_ERR(data->chan))
|
||||
return PTR_ERR(data->chan);
|
||||
|
||||
|
|
@ -170,7 +170,6 @@ static int adc_jack_remove(struct platform_device *pdev)
|
|||
|
||||
free_irq(data->irq, data);
|
||||
cancel_work_sync(&data->handler.work);
|
||||
iio_channel_release(data->chan);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user