lkml.org 
[lkml]   [2023]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] net: dsa: mv88e6xxx: move call to mv88e6xxx_mdios_register()
On Sat, Mar 11, 2023 at 04:19:43PM +0100, Andrew Lunn wrote:
> > static int mv88e6xxx_setup(struct dsa_switch *ds)
> > @@ -3889,6 +3892,10 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
> > int err;
> > int i;
> >
> > + err = mv88e6xxx_mdios_register(chip);
> > + if (err)
> > + return err;
> > +
> > chip->ds = ds;
> > ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip);
>
> Other calls in mv88e6xxx_setup() can fail, so you need to extend the
> cleanup to remove the mdio bus on failure.

FWIW, here is a snippet of how mv88e6xxx_setup() and mv88e6xxx_teardown()
should look like, with error handling taken into consideration (but I
was lazy and just added forward declarations, something which Klaus
handled better with the movement preparatory patch):
https://lore.kernel.org/lkml/20230210210804.vdyfrog5nq6hrxi5@skbuf/

\
 
 \ /
  Last update: 2023-03-27 00:54    [W:0.044 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site