Commit 76af0140 authored by Mark Einon's avatar Mark Einon Committed by Greg Kroah-Hartman

staging: et131x: Remove unnecessary phydev checks

Several checks for a valid adapter->phydev pointer are made where the
pointer has already been checked previously in the code path.
Remove these redundant checks.
Signed-off-by: default avatarMark Einon <mark.einon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b96ab7cc
...@@ -968,7 +968,7 @@ static void et1310_config_mac_regs2(struct et131x_adapter *adapter) ...@@ -968,7 +968,7 @@ static void et1310_config_mac_regs2(struct et131x_adapter *adapter)
/* Set up the if mode bits */ /* Set up the if mode bits */
cfg2 &= ~ET_MAC_CFG2_IFMODE_MASK; cfg2 &= ~ET_MAC_CFG2_IFMODE_MASK;
if (phydev && phydev->speed == SPEED_1000) { if (phydev->speed == SPEED_1000) {
cfg2 |= ET_MAC_CFG2_IFMODE_1000; cfg2 |= ET_MAC_CFG2_IFMODE_1000;
/* Phy mode bit */ /* Phy mode bit */
ifctrl &= ~ET_MAC_IFCTRL_PHYMODE; ifctrl &= ~ET_MAC_IFCTRL_PHYMODE;
...@@ -999,11 +999,11 @@ static void et1310_config_mac_regs2(struct et131x_adapter *adapter) ...@@ -999,11 +999,11 @@ static void et1310_config_mac_regs2(struct et131x_adapter *adapter)
cfg2 &= ~ET_MAC_CFG2_IFMODE_FULL_DPLX; cfg2 &= ~ET_MAC_CFG2_IFMODE_FULL_DPLX;
/* Turn on duplex if needed */ /* Turn on duplex if needed */
if (phydev && phydev->duplex == DUPLEX_FULL) if (phydev->duplex == DUPLEX_FULL)
cfg2 |= ET_MAC_CFG2_IFMODE_FULL_DPLX; cfg2 |= ET_MAC_CFG2_IFMODE_FULL_DPLX;
ifctrl &= ~ET_MAC_IFCTRL_GHDMODE; ifctrl &= ~ET_MAC_IFCTRL_GHDMODE;
if (phydev && phydev->duplex == DUPLEX_HALF) if (phydev->duplex == DUPLEX_HALF)
ifctrl |= ET_MAC_IFCTRL_GHDMODE; ifctrl |= ET_MAC_IFCTRL_GHDMODE;
writel(ifctrl, &mac->if_ctrl); writel(ifctrl, &mac->if_ctrl);
...@@ -2480,9 +2480,6 @@ static void et131x_set_rx_dma_timer(struct et131x_adapter *adapter) ...@@ -2480,9 +2480,6 @@ static void et131x_set_rx_dma_timer(struct et131x_adapter *adapter)
{ {
struct phy_device *phydev = adapter->phydev; struct phy_device *phydev = adapter->phydev;
if (!phydev)
return;
/* For version B silicon, we do not use the RxDMA timer for 10 and 100 /* For version B silicon, we do not use the RxDMA timer for 10 and 100
* Mbits/s line rates. We do not enable and RxDMA interrupt coalescing. * Mbits/s line rates. We do not enable and RxDMA interrupt coalescing.
*/ */
...@@ -3771,7 +3768,7 @@ static void et131x_adjust_link(struct net_device *netdev) ...@@ -3771,7 +3768,7 @@ static void et131x_adjust_link(struct net_device *netdev)
if (phydev->link) { if (phydev->link) {
adapter->boot_coma = 20; adapter->boot_coma = 20;
if (phydev && phydev->speed == SPEED_10) { if (phydev->speed == SPEED_10) {
/* NOTE - Is there a way to query this without /* NOTE - Is there a way to query this without
* TruePHY? * TruePHY?
* && TRU_QueryCoreType(adapter->hTruePhy, 0)== * && TRU_QueryCoreType(adapter->hTruePhy, 0)==
...@@ -3793,7 +3790,7 @@ static void et131x_adjust_link(struct net_device *netdev) ...@@ -3793,7 +3790,7 @@ static void et131x_adjust_link(struct net_device *netdev)
et1310_config_flow_control(adapter); et1310_config_flow_control(adapter);
if (phydev && phydev->speed == SPEED_1000 && if (phydev->speed == SPEED_1000 &&
adapter->registry_jumbo_packet > 2048) { adapter->registry_jumbo_packet > 2048) {
u16 reg; u16 reg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment