Hello Andy,
On 7/18/22 22:27, Andy Shevchenko wrote:
On Mon, Jul 18, 2022 at 9:50 PM Uwe Kleine-König <ukleinek@xxxxxxxxxx> wrote:
There are two exit points in the driver's probe function that fail
silently. From a user perspective this is unsatisfactory because the
device is unusable but there is no hint in the kernel log about the
actual problem which makes it unnecessarily hard to fix the problem.
Make use of dev_err_probe() to emit a problem indication which also does
the right thing if requesting the gpio return -EPROBE_DEFER.
...
+ ret = devm_iio_device_register(dev, iio);
+ if (ret < 0)
Do we really need this ' < 0' part?
Not sure, I stumbled about that when I split the patch, too.
devm_iio_device_register only returns a value <= 0 and I don't expect
dev_err_probe to behave when the error is >= 0. So adding the check at
least documents the expectations. But I don't have hard feelings and
dropping " < 0" would be fine for me, too.
+ return dev_err_probe(dev, ret, "Failed to register iio device\n");
Best regards
Uwe