From: Oleksij Rempel Date: Tue, 10 Feb 2026 13:51:00 +0000 (+0100) Subject: iio: dac: ds4424: ratelimit read errors and use device context X-Git-Tag: v7.1-rc1~17^2~120^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c071adeb72739306bf2960a8f703206979c65196;p=thirdparty%2Fkernel%2Fstable.git iio: dac: ds4424: ratelimit read errors and use device context Replace pr_err() with dev_err_ratelimited() in the RAW read path to avoid log spam on repeated I2C failures and to include the device context. Use %pe to print errno names for faster debugging. Use the parent device context to identify the physical hardware causing the error. Signed-off-by: Oleksij Rempel Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/dac/ds4424.c b/drivers/iio/dac/ds4424.c index c15eb7b5eb960..9d33a810336f7 100644 --- a/drivers/iio/dac/ds4424.c +++ b/drivers/iio/dac/ds4424.c @@ -99,8 +99,9 @@ static int ds4424_read_raw(struct iio_dev *indio_dev, case IIO_CHAN_INFO_RAW: ret = ds4424_get_value(indio_dev, ®val, chan->channel); if (ret < 0) { - pr_err("%s : ds4424_get_value returned %d\n", - __func__, ret); + dev_err_ratelimited(indio_dev->dev.parent, + "Failed to read channel %d: %pe\n", + chan->channel, ERR_PTR(ret)); return ret; }