Skip to content

Commit

Permalink
r8152: remove rtl_phy_reset function
Browse files Browse the repository at this point in the history
In rtl_hw_phy_work_func_t(), the flag of PHY_RESET is set in
rtl_ops.hw_phy_cfg() and cleared in rtl8152_set_speed(). Therefore,
the rtl_phy_reset() is never run and is unnecessary.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
hayeswang authored and David S. Miller committed Jul 9, 2016
1 parent fb57731 commit b164806
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -2450,27 +2450,6 @@ static void rtl8153_runtime_enable(struct r8152 *tp, bool enable)
}
}

static void rtl_phy_reset(struct r8152 *tp)
{
u16 data;
int i;

data = r8152_mdio_read(tp, MII_BMCR);

/* don't reset again before the previous one complete */
if (data & BMCR_RESET)
return;

data |= BMCR_RESET;
r8152_mdio_write(tp, MII_BMCR, data);

for (i = 0; i < 50; i++) {
msleep(20);
if ((r8152_mdio_read(tp, MII_BMCR) & BMCR_RESET) == 0)
break;
}
}

static void r8153_teredo_off(struct r8152 *tp)
{
u32 ocp_data;
Expand Down Expand Up @@ -3069,9 +3048,6 @@ static void rtl_work_func_t(struct work_struct *work)
netif_carrier_ok(tp->netdev))
napi_schedule(&tp->napi);

if (test_and_clear_bit(PHY_RESET, &tp->flags))
rtl_phy_reset(tp);

mutex_unlock(&tp->control);

out1:
Expand Down

0 comments on commit b164806

Please sign in to comment.