summaryrefslogtreecommitdiffstats
path: root/drivers/net/chelsio/cphy.h
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2009-05-20 15:56:12 +0000
committerDavid S. Miller <davem@davemloft.net>2009-05-20 20:51:59 -0700
commit703cebabd173a7fe533d6f21df0347b1f2a9a1e1 (patch)
treecea9c6a7b8b5a4e733a3b2d6366cdcbbfedc8f49 /drivers/net/chelsio/cphy.h
parent86c890ab1b183f8f17ce03c24b62c564e95f957f (diff)
downloadtalos-op-linux-703cebabd173a7fe533d6f21df0347b1f2a9a1e1.tar.gz
talos-op-linux-703cebabd173a7fe533d6f21df0347b1f2a9a1e1.zip
cxgb: set phy's mdio dev before the phy init sequence
mdio's dev field needs to be set before mdio ops occur. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/chelsio/cphy.h')
-rw-r--r--drivers/net/chelsio/cphy.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/chelsio/cphy.h b/drivers/net/chelsio/cphy.h
index 8b5165a5af3f..1f095a9fc739 100644
--- a/drivers/net/chelsio/cphy.h
+++ b/drivers/net/chelsio/cphy.h
@@ -137,10 +137,11 @@ static inline int simple_mdio_write(struct cphy *cphy, int reg,
}
/* Convenience initializer */
-static inline void cphy_init(struct cphy *phy, adapter_t *adapter,
+static inline void cphy_init(struct cphy *phy, struct net_device *dev,
int phy_addr, struct cphy_ops *phy_ops,
const struct mdio_ops *mdio_ops)
{
+ struct adapter *adapter = netdev_priv(dev);
phy->adapter = adapter;
phy->ops = phy_ops;
if (mdio_ops) {
@@ -150,12 +151,13 @@ static inline void cphy_init(struct cphy *phy, adapter_t *adapter,
phy->mdio.mdio_read = mdio_ops->read;
phy->mdio.mdio_write = mdio_ops->write;
}
+ phy->mdio.dev = dev;
}
/* Operations of the PHY-instance factory */
struct gphy {
/* Construct a PHY instance with the given PHY address */
- struct cphy *(*create)(adapter_t *adapter, int phy_addr,
+ struct cphy *(*create)(struct net_device *dev, int phy_addr,
const struct mdio_ops *mdio_ops);
/*
OpenPOWER on IntegriCloud