Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Oleksij Rempel and committed by
Jonathan Cameron
c071adeb a7180136

+3 -2
+3 -2
drivers/iio/dac/ds4424.c
··· 99 99 case IIO_CHAN_INFO_RAW: 100 100 ret = ds4424_get_value(indio_dev, &regval, chan->channel); 101 101 if (ret < 0) { 102 - pr_err("%s : ds4424_get_value returned %d\n", 103 - __func__, ret); 102 + dev_err_ratelimited(indio_dev->dev.parent, 103 + "Failed to read channel %d: %pe\n", 104 + chan->channel, ERR_PTR(ret)); 104 105 return ret; 105 106 } 106 107