Skip to content
Commit e71e6dbe authored by Maxim Kochetkov's avatar Maxim Kochetkov Committed by Jonathan Cameron
Browse files

iio: adc: ti-ads1015: fix conversion when CONFIG_PM is not set



To stop conversion ads1015_set_power_state() function call unimplemented
function __pm_runtime_suspend() from pm_runtime_put_autosuspend()
if CONFIG_PM is not set.
In case of CONFIG_PM is not set: __pm_runtime_suspend() returns -ENOSYS,
so ads1015_read_raw() failed because ads1015_set_power_state() returns an
error.

If CONFIG_PM is disabled, there is no need to start/stop conversion.
Fix it by adding return 0 function variant if CONFIG_PM is not set.

Signed-off-by: default avatarMaxim Kochetkov <fido_max@inbox.ru>
Fixes: ecc24e72 ("iio: adc: Add TI ADS1015 ADC driver support")
Tested-by: default avatarMaxim Kiselev <bigunclemax@gmail.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent ab3300de
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment