Re: [PATCH] gpio: dwapb: Remove unnecessary error message

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

 



On Mon, Nov 30, 2020 at 11:57 AM Damien Le Moal <damien.lemoal@xxxxxxx> wrote:
>
> In dwapb_get_reset(), if devm_reset_control_get_optional_shared() fails,
> an error message is printed even if the failure is the benign
> EPROBE_DEFER error due to the reset controller not yet being
> initialized. Use dev_err_probe() to handle
> devm_reset_control_get_optional_shared() errors to avoid unnecessarilly
> printing an error message for the deferred probe error.
>
> Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxx>
> ---
>  drivers/gpio/gpio-dwapb.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
> index 2a9046c0fb16..ec4f6ceaae68 100644
> --- a/drivers/gpio/gpio-dwapb.c
> +++ b/drivers/gpio/gpio-dwapb.c
> @@ -616,10 +616,9 @@ static int dwapb_get_reset(struct dwapb_gpio *gpio)
>         int err;
>
>         gpio->rst = devm_reset_control_get_optional_shared(gpio->dev, NULL);
> -       if (IS_ERR(gpio->rst)) {
> -               dev_err(gpio->dev, "Cannot get reset descriptor\n");
> -               return PTR_ERR(gpio->rst);
> -       }
> +       if (IS_ERR(gpio->rst))
> +               return dev_err_probe(gpio->dev, PTR_ERR(gpio->rst),
> +                                    "Cannot get reset descriptor\n");
>
>         err = reset_control_deassert(gpio->rst);
>         if (err) {
> --
> 2.28.0
>

Applied, thanks!

Bartosz



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux