Re: [PATCH -next v2] gpio: omap: Remove redundant dev_err_probe()

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

 




On 2023/7/27 20:02, Andy Shevchenko wrote:
> On Thu, Jul 27, 2023 at 07:57:04PM +0800, Ruan Jinjie wrote:
>> There is no need to call the dev_err_probe() function directly to print
>> a custom message when handling an error from platform_get_irq() function as
>> it is going to display an appropriate error message in case of a failure.
> 
> ...
> 
>> @@ -1415,7 +1415,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
>>  	if (bank->irq <= 0) {
>>  		if (!bank->irq)
>>  			bank->irq = -ENXIO;
>> -		return dev_err_probe(dev, bank->irq, "can't get irq resource\n");
>> +		return bank->irq;
>>  	}
> 
> Actually you may go further here and drop a dead code:
> 
> 	if (bank->irq < 0)
> 		return bank->irq;
> 
> will suffice.

You are right! platform_get_irq() do not return 0, I'll fix the issue in v3.

> 



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux