[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87oa7dxdis.fsf@ketchup.mtl.sfl>
Date: Tue, 07 Jun 2016 10:46:35 -0400
From: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
To: Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org
Cc: davem@...emlof.net, andrew@...n.ch,
Florian Fainelli <f.fainelli@...il.com>
Subject: Re: [PATCH net-next v2 5/5] net: dsa: bcm_sf2: Register our slave MDIO bus
Hi Florian,
Florian Fainelli <f.fainelli@...il.com> writes:
> static int bcm_sf2_sw_setup(struct dsa_switch *ds)
> {
> const char *reg_names[BCM_SF2_REGS_NUM] = BCM_SF2_REGS_NAME;
> @@ -972,6 +1099,12 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
> goto out_unmap;
> }
>
> + ret = bcm_sf2_mdio_register(ds);
> + if (ret) {
> + pr_err("failed to register MDIO bus\n");
> + goto out_unmap;
> + }
> +
> /* Disable all interrupts and request them */
> bcm_sf2_intr_disable(priv);
Hum reviewing that again, I see that if one of the 2 subsequent calls to
request_irq fails, you end up with an unregistered MDIO bus.
We have the same issue in the mv88e6xxx legacy probe code if dsa.c fails
to allocate the dsa_switch structure. I'm moving the MDIO register code
to the setup function like you are doing here (good idea!) to fix that.
Thanks,
Vivien
Powered by blists - more mailing lists