diff mbox series

[RFC,net-next,v2,3/5] net: phy: add private data to mdio_device

Message ID 20190828174722.6726-4-boon.leong.ong@intel.com
State RFC
Delegated to: David Miller
Headers show
Series PHY converter driver for DW xPCS IP | expand

Commit Message

Ong Boon Leong Aug. 28, 2019, 5:47 p.m. UTC
PHY converter device is represented as mdio_device and requires private
data. So, we add pointer for private data to mdio_device struct.

Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
---
 include/linux/mdio.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andrew Lunn Aug. 28, 2019, 6:06 p.m. UTC | #1
On Thu, Aug 29, 2019 at 01:47:20AM +0800, Ong Boon Leong wrote:
> PHY converter device is represented as mdio_device and requires private
> data. So, we add pointer for private data to mdio_device struct.

Hi Ong

This was discussed recently with regard to the xilinx_gmii2rgmii.c
driver. You can use the usual dev_get_drvdata() to get private data
associated to the device. I did suggest adding wrappers, so you can
pass a phydev, or and mdiodev.

     Andrew
diff mbox series

Patch

diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index e0ccd56a7ac0..fc7dfbe75006 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -40,6 +40,8 @@  struct mdio_device {
 	struct reset_control *reset_ctrl;
 	unsigned int reset_assert_delay;
 	unsigned int reset_deassert_delay;
+	/* Private data */
+	void *priv;
 };
 #define to_mdio_device(d) container_of(d, struct mdio_device, dev)