diff options
Diffstat (limited to 'drivers/net/sfc/mdio_10g.c')
-rw-r--r-- | drivers/net/sfc/mdio_10g.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c index c4f540e93b79..406494684bb8 100644 --- a/drivers/net/sfc/mdio_10g.c +++ b/drivers/net/sfc/mdio_10g.c | |||
@@ -159,20 +159,19 @@ int mdio_clause45_check_mmds(struct efx_nic *efx, | |||
159 | return 0; | 159 | return 0; |
160 | } | 160 | } |
161 | 161 | ||
162 | int mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask) | 162 | bool mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask) |
163 | { | 163 | { |
164 | int phy_id = efx->mii.phy_id; | 164 | int phy_id = efx->mii.phy_id; |
165 | int status; | 165 | int status; |
166 | int ok = 1; | 166 | bool ok = true; |
167 | int mmd = 0; | 167 | int mmd = 0; |
168 | int good; | ||
169 | 168 | ||
170 | /* If the port is in loopback, then we should only consider a subset | 169 | /* If the port is in loopback, then we should only consider a subset |
171 | * of mmd's */ | 170 | * of mmd's */ |
172 | if (LOOPBACK_INTERNAL(efx)) | 171 | if (LOOPBACK_INTERNAL(efx)) |
173 | return 1; | 172 | return true; |
174 | else if (efx->loopback_mode == LOOPBACK_NETWORK) | 173 | else if (efx->loopback_mode == LOOPBACK_NETWORK) |
175 | return 0; | 174 | return false; |
176 | else if (efx->loopback_mode == LOOPBACK_PHYXS) | 175 | else if (efx->loopback_mode == LOOPBACK_PHYXS) |
177 | mmd_mask &= ~(MDIO_MMDREG_DEVS0_PHYXS | | 176 | mmd_mask &= ~(MDIO_MMDREG_DEVS0_PHYXS | |
178 | MDIO_MMDREG_DEVS0_PCS | | 177 | MDIO_MMDREG_DEVS0_PCS | |
@@ -192,8 +191,7 @@ int mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask) | |||
192 | status = mdio_clause45_read(efx, phy_id, | 191 | status = mdio_clause45_read(efx, phy_id, |
193 | mmd, MDIO_MMDREG_STAT1); | 192 | mmd, MDIO_MMDREG_STAT1); |
194 | 193 | ||
195 | good = status & (1 << MDIO_MMDREG_STAT1_LINK_LBN); | 194 | ok = ok && (status & (1 << MDIO_MMDREG_STAT1_LINK_LBN)); |
196 | ok = ok && good; | ||
197 | } | 195 | } |
198 | mmd_mask = (mmd_mask >> 1); | 196 | mmd_mask = (mmd_mask >> 1); |
199 | mmd++; | 197 | mmd++; |