From: Harini Katakam <harini.katakam@xilinx.com>
To: andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com,
davem@davemloft.net
Cc: michal.simek@xilinx.com, netdev@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, harinikatakamlinux@gmail.com,
harini.katakam@xilinx.com, radhey.shyam.pandey@xilinx.com
Subject: [PATCH v2 1/2] include: mdio: Add driver data helpers
Date: Wed, 4 Sep 2019 19:30:20 +0530 [thread overview]
Message-ID: <1567605621-6818-2-git-send-email-harini.katakam@xilinx.com> (raw)
In-Reply-To: <1567605621-6818-1-git-send-email-harini.katakam@xilinx.com>
Add set/get drv_data helpers for mdio device.
Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
---
v2:
Added this patch driver data helpers in mdio instead of priv field.
include/linux/mdio.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index e8242ad8..a760424 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -68,6 +68,17 @@ struct mdio_driver {
#define to_mdio_driver(d) \
container_of(to_mdio_common_driver(d), struct mdio_driver, mdiodrv)
+/* device driver data */
+static inline void mdiodev_set_drvdata(struct mdio_device *mdio, void *data)
+{
+ dev_set_drvdata(&mdio->dev, data);
+}
+
+static inline void *mdiodev_get_drvdata(struct mdio_device *mdio)
+{
+ return dev_get_drvdata(&mdio->dev);
+}
+
void mdio_device_free(struct mdio_device *mdiodev);
struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr);
int mdio_device_register(struct mdio_device *mdiodev);
--
2.7.4
next prev parent reply other threads:[~2019-09-04 14:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 14:00 [PATCH v2 0/2] Fix GMII2RGMII private field Harini Katakam
2019-09-04 14:00 ` Harini Katakam [this message]
2019-09-04 16:46 ` [PATCH v2 1/2] include: mdio: Add driver data helpers Andrew Lunn
2019-09-04 17:07 ` Florian Fainelli
2019-09-04 14:00 ` [PATCH v2 2/2] net: phy: gmii2rgmii: Dont use priv field in phy device Harini Katakam
2019-09-04 16:47 ` Andrew Lunn
2019-09-04 17:11 ` Florian Fainelli
2019-09-05 10:32 ` [PATCH v2 0/2] Fix GMII2RGMII private field David Miller
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=1567605621-6818-2-git-send-email-harini.katakam@xilinx.com \
--to=harini.katakam@xilinx.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=harinikatakamlinux@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=netdev@vger.kernel.org \
--cc=radhey.shyam.pandey@xilinx.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;
as well as URLs for NNTP newsgroup(s).