mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Marion & Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: Re: [net-next PATCH] net: dsa: add devm_dsa_register_switch()
Date: Fri, 8 Nov 2024 22:43:04 +0100	[thread overview]
Message-ID: <9cf08624-cd84-41bf-beef-ca3b3573303e@lunn.ch> (raw)
In-Reply-To: <672e7a61.050a0220.1d1399.6d31@mx.google.com>

On Fri, Nov 08, 2024 at 09:53:48PM +0100, Christian Marangi wrote:
> On Fri, Nov 08, 2024 at 09:35:32PM +0100, Andrew Lunn wrote:
> > > +int devm_dsa_register_switch(struct device *dev, struct dsa_switch *ds)
> > > +{
> > > +	int err;
> > > +
> > > +	err = dsa_register_switch(ds);
> > > +	if (err)
> > > +		return err;
> > > +
> > > +	return devm_add_action_or_reset(dev, devm_dsa_unregister_switch, ds);
> > > +}
> > > +EXPORT_SYMBOL_GPL(dsa_register_switch);
> > 
> > This looks to be the wrong function name.
> >
> 
> Ah... Anyway aside from this, is the feature OK? Questioning why it
> wasn't proposed early...

Some people blindly make use of devm_ without thinking about
ordering. These helpers can introduce bugs. So they are not always
liked.

It would be best if you added the helper at the same time as its user.

	Andrew

  reply	other threads:[~2024-11-08 21:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 20:02 Christian Marangi
2024-11-08 20:35 ` Andrew Lunn
2024-11-08 20:53   ` Christian Marangi
2024-11-08 21:43     ` Andrew Lunn [this message]
2024-11-08 22:22 ` Christophe JAILLET
2024-11-09  2:50 ` kernel test robot
2024-11-09  3:31 ` kernel test robot

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=9cf08624-cd84-41bf-beef-ca3b3573303e@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®