Re: [PATCH] usb: Replace NO_IRQ by 0

From: Christophe Leroy
Date: Thu Oct 06 2022 - 10:05:49 EST




Le 06/10/2022 à 15:50, Alan Stern a écrit :
> On Thu, Oct 06, 2022 at 07:15:44AM +0200, Christophe Leroy wrote:
>> diff --git a/drivers/usb/host/ehci-grlib.c b/drivers/usb/host/ehci-grlib.c
>> index a2c3b4ec8a8b..0717f2ccf49d 100644
>> --- a/drivers/usb/host/ehci-grlib.c
>> +++ b/drivers/usb/host/ehci-grlib.c
>> @@ -99,7 +99,7 @@ static int ehci_hcd_grlib_probe(struct platform_device *op)
>> hcd->rsrc_len = resource_size(&res);
>>
>> irq = irq_of_parse_and_map(dn, 0);
>> - if (irq == NO_IRQ) {
>> + if (!irq) {
>> dev_err(&op->dev, "%s: irq_of_parse_and_map failed\n",
>> __FILE__);
>> rv = -EBUSY;
>
> Since NO_IRQ is sometimes set to -1, shouldn't this test (and all the
> other ones you changed) really be doing:
>
> if (!irq || irq == NO_IRQ) { ...
>

No, because irq_of_parse_and_map() will never return -1 as an error. It
will always be 0.

The below call gives no result.

git grep -w NO_IRQ drivers/of/ include/