Re: [PATCH 1/2] PCI: kirin: use dev_err_probe() in probe error paths
From: Javier Carrasco
Date: Sat Jul 06 2024 - 16:12:20 EST
On 06/07/2024 21:47, Christophe JAILLET wrote:
> Le 06/07/2024 à 17:07, Javier Carrasco a écrit :
>> dev_err_probe() is used in some probe error paths, yet the
>> "dev_err() + return" pattern is used in some others.
>>
>> Use dev_err_probe() in all error paths with that construction.
>>
>> Suggested-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
>> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
>> ---
>
> ...
>
>> - if (ret < 0) {
>> - dev_err(dev, "failed to parse devfn: %d\n", ret);
>> - return ret;
>> - }
>> + if (ret < 0)
>> + return dev_err_probe(dev, ret,
>> + "failed to parse devfn: %d\n", ret);
>
> Hi,
>
> with dev_err_probe(), there is no more need to add 'ret' explicitly in
> the message.
>
> CJ
You are right, thank you. I will remove that from the original message
for v2.
Best regards,
Javier Carrasco