Re: [PATCH v2 2/3] iio: humidity: dht11: Emit error messages for probe failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

> +               return dev_err_probe(dev, ret, "Failed to register iio device\n");

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux