[PATCH] media: c8sectpfe: convert to gpio descriptors

Arnd Bergmann arnd at arndb.de
Mon Jan 30 10:17:32 PST 2023


On Mon, Jan 30, 2023, at 18:18, Andy Shevchenko wrote:
> On Mon, Jan 30, 2023 at 02:09:47PM +0100, Arnd Bergmann wrote:

>> +		ret = PTR_ERR_OR_ZERO(tsin->rst_gpio);
>>  		if (ret && ret != -EBUSY) {
>> -			dev_err(dev, "Can't request tsin%d reset gpio\n"
>> -				, fei->channel_data[index]->tsin_id);
>> +			dev_err_probe(dev, ret,
>> +				      "reset gpio for tsin%d not valid\n",
>> +				      tsin->tsin_id);
>>  			goto err_node_put;
>>  		}
>>  
>>  		if (!ret) {
>
> Can be 
>
> 	if (IS_ERR() && PTR_ERR() != -EBUSY) {
> 		ret = dev_err_probe(dev, PTR_ERR(), ...);
> 		...
> 	}
>
> 	if (!IS_ERR())
>
> (Up to you)

I prefer the version that only has one PTR_ERR(), but
either way is fine with me.

> But -EBUSY check seems strange to me. What was the motivation behind?
> (As far as I can read the code the possibility to get this if and only
>  if we have requested GPIO too early at initcall level. Would it be
>  ever a possibility to get it in real life?)

I noticed this part as being odd as well, no idea why the
code is like this. I just left the logic unchanged here.

      Arnd



More information about the linux-arm-kernel mailing list