Re: [PATCH v3 11/13] ASoC: arizona-jack: Cleanup logging

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

 



On Fri, Jan 22, 2021 at 6:41 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> Cleanup the use of dev_foo functions used for logging:
>
> 1. Many of these are unnecessarily split over multiple lines
> 2. Use dev_err_probe() in cases where we might get a -EPROBE_DEFERRED

s/RED$//

>    return value

...

> +               if (ret != 0)

Since you are touching it if (ret) would work already. Ditto for the
similar cases below.

...

>         if (IS_ERR(info->micvdd)) {
>                 ret = PTR_ERR(info->micvdd);
> -               dev_err(arizona->dev, "Failed to get MICVDD: %d\n", ret);
> +               dev_err_probe(arizona->dev, ret, "getting MICVDD\n");
>                 return ret;
>         }

Seems like your first dev_err_probe use :-)
Can be even more optimized, i.e.

  if (IS_ERR(info->micvdd))
    return dev_err_probe(arizona->dev, PTR_ERR(info->micvdd), "getting
MICVDD\n");

...

>                 if (IS_ERR(info->micd_pol_gpio)) {
>                         ret = PTR_ERR(info->micd_pol_gpio);
> -                       dev_err(arizona->dev,
> -                               "Failed to get microphone polarity GPIO: %d\n",
> -                               ret);
> +                       dev_err_probe(arizona->dev, ret, "getting microphone polarity GPIO\n");
>                         return ret;
>                 }

Ditto.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux