Re: [PATCH v2 3/3] iio: humidity: dht11: Use dev_err_probe consistently

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

 



On Mon, Jul 18, 2022 at 9:51 PM Uwe Kleine-König <ukleinek@xxxxxxxxxx> wrote:
>
> All but one error path use dev_err_probe() to emit a message. Use the same
> incarnation for the remaining exit point for consistency.

...

> +       if (dht11->irq < 0)
> +               return dev_err_probe(dev, -EINVAL, "GPIO %d has no interrupt\n",
> +                                    desc_to_gpio(dht11->gpiod));

Oh, what I missed is the error code shadowing. Can't we propagate the
real error code?
-EINVAL --> dht11->irq

And to be honest I don't like this desc_to_gpio() usage. It's not for
board files, it will bring confusing information to the user. What is
important is the name of GPIO, i.o.w. "connection id".

-- 
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