[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1567605621-6818-2-git-send-email-harini.katakam@xilinx.com>
Date: Wed, 4 Sep 2019 19:30:20 +0530
From: Harini Katakam <harini.katakam@...inx.com>
To: andrew@...n.ch, f.fainelli@...il.com, hkallweit1@...il.com,
davem@...emloft.net
Cc: michal.simek@...inx.com, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
harinikatakamlinux@...il.com, harini.katakam@...inx.com,
radhey.shyam.pandey@...inx.com
Subject: [PATCH v2 1/2] include: mdio: Add driver data helpers
Add set/get drv_data helpers for mdio device.
Signed-off-by: Harini Katakam <harini.katakam@...inx.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
Powered by blists - more mailing lists