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

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

 



HI,

On 1/22/21 9:56 PM, Andy Shevchenko wrote:
> 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$//

Ack, will fix for v4.


>>    return value
> 
> ...
> 
>> +               if (ret != 0)
> 
> Since you are touching it if (ret) would work already. Ditto for the
> similar cases below.

Ack.

> ...
> 
>>         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 :-)

Erm, nope. I did this on purpose.

> 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");

Ok, so that works here, but I deliberately kept it as is because it does
not work below and I wanted to be consistent.

On second thought. That is not really a good reason, so I've
made this a 1-lines as you suggest for v4.

> 
> ...
> 
>>                 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");

This new line is 96 chars as-is if I turn this into a one-liner it goes significantly
over the 100 chars line-length limit.

So I've kept this as is for v4.

Regards,

Hans




[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