diff mbox series

[V3,net-next,1/7] net: bcmgenet: Avoid touching non-existent interrupt

Message ID 1573326009-2275-2-git-send-email-wahrenst@gmx.net
State Changes Requested
Delegated to: David Miller
Headers show
Series ARM: Enable GENET support for RPi 4 | expand

Commit Message

Stefan Wahren Nov. 9, 2019, 7 p.m. UTC
As platform_get_irq() now prints an error when the interrupt does not
exist, we are getting a confusing error message in case the optional
WOL IRQ is not defined:

  bcmgenet fd58000.ethernet: IRQ index 2 not found

Fix this by using the platform_get_irq_optional().

Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.7.4

Comments

Florian Fainelli Nov. 10, 2019, 8:23 p.m. UTC | #1
On 11/9/2019 11:00 AM, Stefan Wahren wrote:
> As platform_get_irq() now prints an error when the interrupt does not
> exist, we are getting a confusing error message in case the optional
> WOL IRQ is not defined:
> 
>   bcmgenet fd58000.ethernet: IRQ index 2 not found
> 
> Fix this by using the platform_get_irq_optional().
> 
> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()")
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>

I still don't think this warrant a Fixes tag, as this is not a bug
per-se, just a minor annoyance:

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Stefan Wahren Nov. 10, 2019, 8:57 p.m. UTC | #2
Hi Florian,

Am 10.11.19 um 21:23 schrieb Florian Fainelli:
>
> On 11/9/2019 11:00 AM, Stefan Wahren wrote:
>> As platform_get_irq() now prints an error when the interrupt does not
>> exist, we are getting a confusing error message in case the optional
>> WOL IRQ is not defined:
>>
>>   bcmgenet fd58000.ethernet: IRQ index 2 not found
>>
>> Fix this by using the platform_get_irq_optional().
>>
>> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()")
>> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> I still don't think this warrant a Fixes tag, as this is not a bug
> per-se, just a minor annoyance:

this confuses me. In V2 you said this about patch "net: bcmgenet: Fix
error handling on IRQ retrieval".

Is it possible you commented the wrong patch last time?
Florian Fainelli Nov. 10, 2019, 9:10 p.m. UTC | #3
On 11/10/2019 12:57 PM, Stefan Wahren wrote:
> Hi Florian,
> 
> Am 10.11.19 um 21:23 schrieb Florian Fainelli:
>>
>> On 11/9/2019 11:00 AM, Stefan Wahren wrote:
>>> As platform_get_irq() now prints an error when the interrupt does not
>>> exist, we are getting a confusing error message in case the optional
>>> WOL IRQ is not defined:
>>>
>>>   bcmgenet fd58000.ethernet: IRQ index 2 not found
>>>
>>> Fix this by using the platform_get_irq_optional().
>>>
>>> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()")
>>> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
>> I still don't think this warrant a Fixes tag, as this is not a bug
>> per-se, just a minor annoyance:
> 
> this confuses me. In V2 you said this about patch "net: bcmgenet: Fix
> error handling on IRQ retrieval".
> 
> Is it possible you commented the wrong patch last time?

In v2, on patch 1, I wrote this:

Not sure if the Fixes tag is necessary here, this is kind of an
exceptional case anyway since you should be specifying valid interrupt
resources to begin with.

and on v2, on patch 2, I just suggested using
platform_get_irq_optional() but did not comment on your choice of Fixes:
tag, but now I just did, and for the same reasons as patch #1, I think
this is not necessary.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 4f689fb..9f68ee1 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3465,7 +3465,7 @@  static int bcmgenet_probe(struct platform_device *pdev)
 	priv = netdev_priv(dev);
 	priv->irq0 = platform_get_irq(pdev, 0);
 	priv->irq1 = platform_get_irq(pdev, 1);
-	priv->wol_irq = platform_get_irq(pdev, 2);
+	priv->wol_irq = platform_get_irq_optional(pdev, 2);
 	if (!priv->irq0 || !priv->irq1) {
 		dev_err(&pdev->dev, "can't find IRQs\n");
 		err = -EINVAL;