summaryrefslogtreecommitdiff
path: root/include/linux/mdio.h
diff options
context:
space:
mode:
authorHarini Katakam <harini.katakam@xilinx.com>2019-09-04 19:30:20 +0530
committerDavid S. Miller <davem@davemloft.net>2019-09-05 12:32:05 +0200
commit36b1a2fcd0d263cec3d1a896386611195329af84 (patch)
tree169c4d78fde162ace6579d42f9a2c79ece7cb9a7 /include/linux/mdio.h
parent1ddee6d843d841414039414923620c8160aec623 (diff)
include: mdio: Add driver data helpers
Add set/get drv_data helpers for mdio device. Signed-off-by: Harini Katakam <harini.katakam@xilinx.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mdio.h')
-rw-r--r--include/linux/mdio.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index e8242ad88c81..a7604248777b 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);