Skip to content

Commit e05c518

Browse files
committed
Merge branch 'pcs_get_state-fixes'
Russell King (Oracle) says: ==================== Minor fixes for pcs_get_state() implementations This series contains a number fixes for minor issues with some pcs_get_state() implementations, particualrly for the phylink state->an_enabled member. As they are minor, I'm suggesting we queue them in net-next as there is follow-on work for these, and there is no urgency for them to be in -rc. Just like phylib, state->advertising's Autoneg bit is a copy of state->an_enabled, and thus it is my intention to remove state->an_enabled from phylink to simplify things. This series gets rid of state->an_enabled assignments or reporting that should never have been there. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents abf3670 + ecec0eb commit e05c518

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

drivers/net/pcs/pcs-lynx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ static void lynx_pcs_get_state(struct phylink_pcs *pcs,
112112
}
113113

114114
dev_dbg(&lynx->mdio->dev,
115-
"mode=%s/%s/%s link=%u an_enabled=%u an_complete=%u\n",
115+
"mode=%s/%s/%s link=%u an_complete=%u\n",
116116
phy_modes(state->interface),
117117
phy_speed_to_str(state->speed),
118118
phy_duplex_to_str(state->duplex),
119-
state->link, state->an_enabled, state->an_complete);
119+
state->link, state->an_complete);
120120
}
121121

122122
static int lynx_pcs_config_giga(struct mdio_device *pcs, unsigned int mode,

drivers/net/pcs/pcs-xpcs.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static int xpcs_read_fault_c73(struct dw_xpcs *xpcs,
321321
return 0;
322322
}
323323

324-
static int xpcs_read_link_c73(struct dw_xpcs *xpcs, bool an)
324+
static int xpcs_read_link_c73(struct dw_xpcs *xpcs)
325325
{
326326
bool link = true;
327327
int ret;
@@ -333,15 +333,6 @@ static int xpcs_read_link_c73(struct dw_xpcs *xpcs, bool an)
333333
if (!(ret & MDIO_STAT1_LSTATUS))
334334
link = false;
335335

336-
if (an) {
337-
ret = xpcs_read(xpcs, MDIO_MMD_AN, MDIO_STAT1);
338-
if (ret < 0)
339-
return ret;
340-
341-
if (!(ret & MDIO_STAT1_LSTATUS))
342-
link = false;
343-
}
344-
345336
return link;
346337
}
347338

@@ -935,7 +926,7 @@ static int xpcs_get_state_c73(struct dw_xpcs *xpcs,
935926
int ret;
936927

937928
/* Link needs to be read first ... */
938-
state->link = xpcs_read_link_c73(xpcs, state->an_enabled) > 0 ? 1 : 0;
929+
state->link = xpcs_read_link_c73(xpcs) > 0 ? 1 : 0;
939930

940931
/* ... and then we check the faults. */
941932
ret = xpcs_read_fault_c73(xpcs, state);

0 commit comments

Comments
 (0)