iio: adc: ad4170-4: Use ERR_PTR() in ad4170_read_sample()
Subsystems (3)
PATCH 1/1 iio: adc: ad4170-4: Use ERR_PTR() in ad4170_read_sample()
Use ERR_PTR(ret) with %pe in ad4170_read_sample() to properly display symbolic error codes (e.g. -ENOMEM) instead of raw integers (e.g. -12), improving readability and debug clarity.
Signed-off-by Salah Triki <[email protected]>
--- drivers/iio/adc/ad4170-4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/ad4170-4.c +2 -2
@@ -1253,11 +1253,11 @@ static int ad4170_read_sample(struct iio_dev *indio_dev, ret =__ad4170_read_sample (indio_dev, chan, val);if (ret) { -dev_err (dev,"failed to read sample: %d\n" , ret); +dev_err (dev,"failed to read sample: %pe\n" ,ERR_PTR (ret)); ret2 =ad4170_set_channel_enable (st, chan->address, false);if (ret2) -dev_err (dev,"failed to disable channel: %d\n" , ret2); +dev_err (dev,"failed to disable channel: %pe\n" ,ERR_PTR (ret2));return ret; }
Signature · 1 line
2.43.0