summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/iio_hwmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/iio_hwmon.c')
-rw-r--r--drivers/hwmon/iio_hwmon.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
index 3aa40893fc09..4c8a80847891 100644
--- a/drivers/hwmon/iio_hwmon.c
+++ b/drivers/hwmon/iio_hwmon.c
@@ -77,9 +77,11 @@ static int iio_hwmon_probe(struct platform_device *pdev)
channels = devm_iio_channel_get_all(dev);
if (IS_ERR(channels)) {
- if (PTR_ERR(channels) == -ENODEV)
- return -EPROBE_DEFER;
- return PTR_ERR(channels);
+ ret = PTR_ERR(channels);
+ if (ret == -ENODEV)
+ ret = -EPROBE_DEFER;
+ return dev_err_probe(dev, ret,
+ "Failed to get channels\n");
}
st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);