From: andy.shevchenko@gmail.com
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Jiawen Wu <jiawenwu@trustnetic.com>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
Simon Horman <simon.horman@corigine.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next 1/6] net: mdio: add mdio_device_get() and mdio_device_put()
Date: Fri, 26 May 2023 21:20:17 +0300 [thread overview]
Message-ID: <ZHD4Yaf7fgtgOgTS@surfacebook> (raw)
In-Reply-To: <E1q2USm-008PAO-Gx@rmk-PC.armlinux.org.uk>
Fri, May 26, 2023 at 11:14:24AM +0100, Russell King (Oracle) kirjoitti:
> Add two new operations for a mdio device to manage the refcount on the
> underlying struct device. This will be used by mdio PCS drivers to
> simplify the creation and destruction handling, making it easier for
> users to get it correct.
...
> +static inline void mdio_device_get(struct mdio_device *mdiodev)
> +{
> + get_device(&mdiodev->dev);
Dunno what is the practice in net, but it makes sense to have the pattern as
if (mdiodev)
return to_mdiodev(get_device(&mdiodev->dev));
which might be helpful in some cases. This approach is used in many cases in
the kernel.
> +}
P.S. Just my 2c, you may ignore the above comment.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-05-26 18:20 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 10:13 [PATCH net-next 0/6] net: pcs: add helpers to xpcs and lynx to manage mdiodev Russell King (Oracle)
2023-05-26 10:13 ` Russell King (Oracle)
2023-05-26 10:14 ` [PATCH net-next 1/6] net: mdio: add mdio_device_get() and mdio_device_put() Russell King (Oracle)
2023-05-26 18:20 ` andy.shevchenko [this message]
2023-05-29 15:21 ` Andrew Lunn
2023-05-29 20:34 ` Andy Shevchenko
2023-05-29 22:41 ` Russell King (Oracle)
2023-05-29 15:18 ` Andrew Lunn
2023-05-26 10:14 ` [PATCH net-next 2/6] net: pcs: xpcs: add xpcs_create_mdiodev() Russell King (Oracle)
2023-05-29 15:25 ` Andrew Lunn
2023-05-29 16:05 ` Russell King (Oracle)
2023-05-29 16:27 ` Vladimir Oltean
2023-05-26 10:14 ` [PATCH net-next 3/6] net: stmmac: use xpcs_create_mdiodev() Russell King (Oracle)
2023-05-26 10:14 ` Russell King (Oracle)
2023-05-29 15:26 ` Andrew Lunn
2023-05-29 15:26 ` Andrew Lunn
2023-05-26 10:14 ` [PATCH net-next 4/6] net: pcs: lynx: add lynx_pcs_create_mdiodev() Russell King (Oracle)
2023-05-26 18:22 ` andy.shevchenko
2023-05-29 15:28 ` Andrew Lunn
2023-05-29 17:08 ` Ioana Ciornei
2023-05-26 10:14 ` [PATCH net-next 5/6] net: dsa: ocelot: use lynx_pcs_create_mdiodev() Russell King (Oracle)
2023-05-29 15:28 ` Andrew Lunn
2023-05-29 15:47 ` Vladimir Oltean
2023-05-26 10:14 ` [PATCH net-next 6/6] net: enetc: " Russell King (Oracle)
2023-05-29 15:29 ` Andrew Lunn
2023-05-29 15:46 ` Vladimir Oltean
2023-05-30 5:00 ` [PATCH net-next 0/6] net: pcs: add helpers to xpcs and lynx to manage mdiodev patchwork-bot+netdevbpf
2023-05-30 5:00 ` patchwork-bot+netdevbpf
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=ZHD4Yaf7fgtgOgTS@surfacebook \
--to=andy.shevchenko@gmail.com \
--cc=andrew@lunn.ch \
--cc=hkallweit1@gmail.com \
--cc=jiawenwu@trustnetic.com \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=rmk+kernel@armlinux.org.uk \
--cc=simon.horman@corigine.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.