Skip to content
Commit c6a3fcf9 authored by Sean Nyekjaer's avatar Sean Nyekjaer Committed by Greg Kroah-Hartman
Browse files

iio: adc: stm32-adc: skip adc-channels setup if none is present

commit 3e27ef0c upstream.

If only adc differential channels are defined driver will fail with
stm32-adc: probe of 48003000.adc:adc@0 failed with error -22

Fix this by skipping the initialization if no channels are defined.

This applies only to the legacy way of initializing adc channels.

Fixes: d7705f35

 ("iio: adc: stm32-adc: convert to device properties")
Signed-off-by: default avatarSean Nyekjaer <sean@geanix.com>
Reviewed-by: default avatarOlivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20230503162029.3654093-2-sean@geanix.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1628d08f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment