Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Klaus Kudielka <klaus.kudielka@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] net: dsa: mv88e6xxx: move call to mv88e6xxx_mdios_register()
Date: Sat, 11 Mar 2023 20:09:01 +0200	[thread overview]
Message-ID: <20230311180901.m45p5c26ln35cc6a@skbuf> (raw)
In-Reply-To: <98767929-b401-402b-8e6b-d997cf27bfb0@lunn.ch>

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/

  reply	other threads:[~2023-03-11 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-11  9:41 [PATCH 1/2] net: dsa: mv88e6xxx: re-order functions Klaus Kudielka
2023-03-11  9:41 ` [PATCH 2/2] net: dsa: mv88e6xxx: move call to mv88e6xxx_mdios_register() Klaus Kudielka
2023-03-11 15:19   ` Andrew Lunn
2023-03-11 18:09     ` Vladimir Oltean [this message]
2023-03-11 18:06   ` Vladimir Oltean
2023-03-11 14:53 ` [PATCH 1/2] net: dsa: mv88e6xxx: re-order functions Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230311180901.m45p5c26ln35cc6a@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=klaus.kudielka@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox