提交 3340d2aa 编写于 作者: S Sergei Shtylyov 提交者: David S. Miller

sh_eth: make 'link' field of 'struct sh_eth_private' *int*

The 'link' field of 'struct sh_eth_private' has type 'enum phy_state' while the
'link' field of 'struct phy_device' is merely *int* (having values 0 and 1) and
the former field gets assigned from the latter. Make the field match, getting
rid of incorrectly used PHY_DOWN value in assignments/comparisons.
Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3893b273
...@@ -1377,7 +1377,7 @@ static void sh_eth_adjust_link(struct net_device *ndev) ...@@ -1377,7 +1377,7 @@ static void sh_eth_adjust_link(struct net_device *ndev)
struct phy_device *phydev = mdp->phydev; struct phy_device *phydev = mdp->phydev;
int new_state = 0; int new_state = 0;
if (phydev->link != PHY_DOWN) { if (phydev->link) {
if (phydev->duplex != mdp->duplex) { if (phydev->duplex != mdp->duplex) {
new_state = 1; new_state = 1;
mdp->duplex = phydev->duplex; mdp->duplex = phydev->duplex;
...@@ -1391,7 +1391,7 @@ static void sh_eth_adjust_link(struct net_device *ndev) ...@@ -1391,7 +1391,7 @@ static void sh_eth_adjust_link(struct net_device *ndev)
if (mdp->cd->set_rate) if (mdp->cd->set_rate)
mdp->cd->set_rate(ndev); mdp->cd->set_rate(ndev);
} }
if (mdp->link == PHY_DOWN) { if (!mdp->link) {
sh_eth_write(ndev, sh_eth_write(ndev,
(sh_eth_read(ndev, ECMR) & ~ECMR_TXF), ECMR); (sh_eth_read(ndev, ECMR) & ~ECMR_TXF), ECMR);
new_state = 1; new_state = 1;
...@@ -1401,7 +1401,7 @@ static void sh_eth_adjust_link(struct net_device *ndev) ...@@ -1401,7 +1401,7 @@ static void sh_eth_adjust_link(struct net_device *ndev)
} }
} else if (mdp->link) { } else if (mdp->link) {
new_state = 1; new_state = 1;
mdp->link = PHY_DOWN; mdp->link = 0;
mdp->speed = 0; mdp->speed = 0;
mdp->duplex = -1; mdp->duplex = -1;
if (mdp->cd->no_psr || mdp->no_ether_link) if (mdp->cd->no_psr || mdp->no_ether_link)
...@@ -1422,7 +1422,7 @@ static int sh_eth_phy_init(struct net_device *ndev) ...@@ -1422,7 +1422,7 @@ static int sh_eth_phy_init(struct net_device *ndev)
snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT,
mdp->mii_bus->id , mdp->phy_id); mdp->mii_bus->id , mdp->phy_id);
mdp->link = PHY_DOWN; mdp->link = 0;
mdp->speed = 0; mdp->speed = 0;
mdp->duplex = -1; mdp->duplex = -1;
......
...@@ -723,7 +723,7 @@ struct sh_eth_private { ...@@ -723,7 +723,7 @@ struct sh_eth_private {
u32 phy_id; /* PHY ID */ u32 phy_id; /* PHY ID */
struct mii_bus *mii_bus; /* MDIO bus control */ struct mii_bus *mii_bus; /* MDIO bus control */
struct phy_device *phydev; /* PHY device control */ struct phy_device *phydev; /* PHY device control */
enum phy_state link; int link;
phy_interface_t phy_interface; phy_interface_t phy_interface;
int msg_enable; int msg_enable;
int speed; int speed;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册