Skip to content

Commit ca76334

Browse files
IoanaCiorneikuba-moo
authored andcommitted
dpaa2-mac: remove an unnecessary check
The dpaa2-eth driver has phylink integration only if the connected dpmac object is in TYPE_PHY (aka the PCS/PHY etc link status is managed by Linux instead of the firmware). The check is thus unnecessary because the code path that reaches the .mac_link_up() callback is only with TYPE_PHY dpmac objects. Signed-off-by: Ioana Ciornei <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 47325da commit ca76334

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -174,30 +174,25 @@ static void dpaa2_mac_link_up(struct phylink_config *config,
174174

175175
dpmac_state->up = 1;
176176

177-
if (mac->if_link_type == DPMAC_LINK_TYPE_PHY) {
178-
/* If the DPMAC is configured for PHY mode, we need
179-
* to pass the link parameters to the MC firmware.
180-
*/
181-
dpmac_state->rate = speed;
182-
183-
if (duplex == DUPLEX_HALF)
184-
dpmac_state->options |= DPMAC_LINK_OPT_HALF_DUPLEX;
185-
else if (duplex == DUPLEX_FULL)
186-
dpmac_state->options &= ~DPMAC_LINK_OPT_HALF_DUPLEX;
187-
188-
/* This is lossy; the firmware really should take the pause
189-
* enablement status rather than pause/asym pause status.
190-
*/
191-
if (rx_pause)
192-
dpmac_state->options |= DPMAC_LINK_OPT_PAUSE;
193-
else
194-
dpmac_state->options &= ~DPMAC_LINK_OPT_PAUSE;
195-
196-
if (rx_pause ^ tx_pause)
197-
dpmac_state->options |= DPMAC_LINK_OPT_ASYM_PAUSE;
198-
else
199-
dpmac_state->options &= ~DPMAC_LINK_OPT_ASYM_PAUSE;
200-
}
177+
dpmac_state->rate = speed;
178+
179+
if (duplex == DUPLEX_HALF)
180+
dpmac_state->options |= DPMAC_LINK_OPT_HALF_DUPLEX;
181+
else if (duplex == DUPLEX_FULL)
182+
dpmac_state->options &= ~DPMAC_LINK_OPT_HALF_DUPLEX;
183+
184+
/* This is lossy; the firmware really should take the pause
185+
* enablement status rather than pause/asym pause status.
186+
*/
187+
if (rx_pause)
188+
dpmac_state->options |= DPMAC_LINK_OPT_PAUSE;
189+
else
190+
dpmac_state->options &= ~DPMAC_LINK_OPT_PAUSE;
191+
192+
if (rx_pause ^ tx_pause)
193+
dpmac_state->options |= DPMAC_LINK_OPT_ASYM_PAUSE;
194+
else
195+
dpmac_state->options &= ~DPMAC_LINK_OPT_ASYM_PAUSE;
201196

202197
err = dpmac_set_link_state(mac->mc_io, 0,
203198
mac->mc_dev->mc_handle, dpmac_state);

0 commit comments

Comments
 (0)