From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: Free ATU/VTU irq only when there is chip irq Date: Mon, 15 Jan 2018 14:54:22 -0800 Message-ID: <715ef97b-128e-3feb-a3e9-f6963cf0be49@gmail.com> References: <1516056358-4852-1-git-send-email-andrew@lunn.ch> <1516056358-4852-3-git-send-email-andrew@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev , Vivien Didelot To: Andrew Lunn , David Miller Return-path: Received: from mail-qk0-f194.google.com ([209.85.220.194]:36735 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbeAOWy0 (ORCPT ); Mon, 15 Jan 2018 17:54:26 -0500 Received: by mail-qk0-f194.google.com with SMTP id d21so18759204qkj.3 for ; Mon, 15 Jan 2018 14:54:26 -0800 (PST) In-Reply-To: <1516056358-4852-3-git-send-email-andrew@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/15/2018 02:45 PM, Andrew Lunn wrote: > We only register the ATU and VTU irq when we have a chip level IRQ. > In the error path, we should only attempt to remove the ATU and VTU > irq if we also have a chip level IRQ. > > Signed-off-by: Andrew Lunn > --- > drivers/net/dsa/mv88e6xxx/chip.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c > index 54cb00a27408..eb328bade225 100644 > --- a/drivers/net/dsa/mv88e6xxx/chip.c > +++ b/drivers/net/dsa/mv88e6xxx/chip.c > @@ -3999,9 +3999,11 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev) > out_mdio: > mv88e6xxx_mdios_unregister(chip); > out_g1_vtu_prob_irq: > - mv88e6xxx_g1_vtu_prob_irq_free(chip); > + if (chip->irq > 0) > + mv88e6xxx_g1_vtu_prob_irq_free(chip); Why not move this check to mv88e6xxx_g1_vtu_prob_irq_free() and make it a no-op if chip->irq <= 0? -- Florian