diff options
| author | Oleksij Rempel <o.rempel@pengutronix.de> | 2026-02-10 14:51:00 +0100 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2026-03-22 12:38:30 +0000 |
| commit | c071adeb72739306bf2960a8f703206979c65196 (patch) | |
| tree | a03b412336650c12a4731b7d51bd4f9e315b0323 | |
| parent | a718013647dcd5aca14c9a8856e1dab694e846ae (diff) | |
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 <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
| -rw-r--r-- | drivers/iio/dac/ds4424.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iio/dac/ds4424.c b/drivers/iio/dac/ds4424.c index c15eb7b5eb96..9d33a810336f 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; } |
