Skip to content

Commit

Permalink
r8169: remove rtl_ocpdr_cond.
Browse files Browse the repository at this point in the history
It is not needed for mac_ocp_{write / read}. Actually bit 31 of OCPDR
does not change and r8168_mac_ocp_read always returns ~0.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Tested-by: Francois Romieu <romieu@fr.zoreil.com>
  • Loading branch information
Hayes Wang authored and Francois Romieu committed Jul 17, 2012
1 parent 5abf7f7 commit 3a83ad1
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,13 +1043,6 @@ static void rtl_w1w0_phy_ocp(struct rtl8169_private *tp, int reg, int p, int m)
r8168_phy_ocp_write(tp, reg, (val | p) & ~m);
}

DECLARE_RTL_COND(rtl_ocpdr_cond)
{
void __iomem *ioaddr = tp->mmio_addr;

return RTL_R32(OCPDR) & OCPAR_FLAG;
}

static void r8168_mac_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
{
void __iomem *ioaddr = tp->mmio_addr;
Expand All @@ -1058,8 +1051,6 @@ static void r8168_mac_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
return;

RTL_W32(OCPDR, OCPAR_FLAG | (reg << 15) | data);

rtl_udelay_loop_wait_low(tp, &rtl_ocpdr_cond, 25, 10);
}

static u16 r8168_mac_ocp_read(struct rtl8169_private *tp, u32 reg)
Expand All @@ -1071,8 +1062,7 @@ static u16 r8168_mac_ocp_read(struct rtl8169_private *tp, u32 reg)

RTL_W32(OCPDR, reg << 15);

return rtl_udelay_loop_wait_high(tp, &rtl_ocpdr_cond, 25, 10) ?
RTL_R32(OCPDR) : ~0;
return RTL_R32(OCPDR);
}

#define OCP_STD_PHY_BASE 0xa400
Expand Down

0 comments on commit 3a83ad1

Please sign in to comment.