diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2010-06-26 19:16:06 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2010-06-26 19:16:06 +0000 |
commit | 5078264bef13956d79fb658c22c945ac711486ae (patch) | |
tree | 4495b4ffb142a3e01b0f61b3473d1c97e314da42 /target/linux/generic-2.6/files/drivers/net/phy | |
parent | 47de539b93f63e37a91bd407bc67dc7a00debd53 (diff) | |
download | upstream-5078264bef13956d79fb658c22c945ac711486ae.tar.gz upstream-5078264bef13956d79fb658c22c945ac711486ae.tar.bz2 upstream-5078264bef13956d79fb658c22c945ac711486ae.zip |
generic: rtl8366: use struct rtl8366_smi for phy_reg_{read,write} calls
SVN-Revision: 21912
Diffstat (limited to 'target/linux/generic-2.6/files/drivers/net/phy')
-rw-r--r-- | target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c | 16 | ||||
-rw-r--r-- | target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c | 16 |
2 files changed, 14 insertions, 18 deletions
diff --git a/target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c index d453fa497b..7125bb8aa1 100644 --- a/target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c +++ b/target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c @@ -257,10 +257,9 @@ static int rtl8366rb_reset_chip(struct rtl8366rb *rtl) return 0; } -static int rtl8366rb_read_phy_reg(struct rtl8366rb *rtl, +static int rtl8366rb_read_phy_reg(struct rtl8366_smi *smi, u32 phy_no, u32 page, u32 addr, u32 *data) { - struct rtl8366_smi *smi = &rtl->smi; u32 reg; int ret; @@ -293,10 +292,9 @@ static int rtl8366rb_read_phy_reg(struct rtl8366rb *rtl, return 0; } -static int rtl8366rb_write_phy_reg(struct rtl8366rb *rtl, +static int rtl8366rb_write_phy_reg(struct rtl8366_smi *smi, u32 phy_no, u32 page, u32 addr, u32 data) { - struct rtl8366_smi *smi = &rtl->smi; u32 reg; int ret; @@ -1502,11 +1500,11 @@ static void rtl8366rb_switch_cleanup(struct rtl8366rb *rtl) static int rtl8366rb_mii_read(struct mii_bus *bus, int addr, int reg) { - struct rtl8366rb *rtl = smi_to_rtl8366rb(bus->priv); + struct rtl8366_smi *smi = bus->priv; u32 val = 0; int err; - err = rtl8366rb_read_phy_reg(rtl, addr, 0, reg, &val); + err = rtl8366rb_read_phy_reg(smi, addr, 0, reg, &val); if (err) return 0xffff; @@ -1515,13 +1513,13 @@ static int rtl8366rb_mii_read(struct mii_bus *bus, int addr, int reg) static int rtl8366rb_mii_write(struct mii_bus *bus, int addr, int reg, u16 val) { - struct rtl8366rb *rtl = smi_to_rtl8366rb(bus->priv); + struct rtl8366_smi *smi = bus->priv; u32 t; int err; - err = rtl8366rb_write_phy_reg(rtl, addr, 0, reg, val); + err = rtl8366rb_write_phy_reg(smi, addr, 0, reg, val); /* flush write */ - (void) rtl8366rb_read_phy_reg(rtl, addr, 0, reg, &t); + (void) rtl8366rb_read_phy_reg(smi, addr, 0, reg, &t); return err; } diff --git a/target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c b/target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c index 9f378657fc..2af32eee4d 100644 --- a/target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c +++ b/target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c @@ -257,10 +257,9 @@ static int rtl8366s_reset_chip(struct rtl8366s *rtl) return 0; } -static int rtl8366s_read_phy_reg(struct rtl8366s *rtl, +static int rtl8366s_read_phy_reg(struct rtl8366_smi *smi, u32 phy_no, u32 page, u32 addr, u32 *data) { - struct rtl8366_smi *smi = &rtl->smi; u32 reg; int ret; @@ -293,10 +292,9 @@ static int rtl8366s_read_phy_reg(struct rtl8366s *rtl, return 0; } -static int rtl8366s_write_phy_reg(struct rtl8366s *rtl, +static int rtl8366s_write_phy_reg(struct rtl8366_smi *smi, u32 phy_no, u32 page, u32 addr, u32 data) { - struct rtl8366_smi *smi = &rtl->smi; u32 reg; int ret; @@ -1471,11 +1469,11 @@ static void rtl8366s_switch_cleanup(struct rtl8366s *rtl) static int rtl8366s_mii_read(struct mii_bus *bus, int addr, int reg) { - struct rtl8366s *rtl = smi_to_rtl8366s(bus->priv); + struct rtl8366_smi *smi = bus->priv; u32 val = 0; int err; - err = rtl8366s_read_phy_reg(rtl, addr, 0, reg, &val); + err = rtl8366s_read_phy_reg(smi, addr, 0, reg, &val); if (err) return 0xffff; @@ -1484,13 +1482,13 @@ static int rtl8366s_mii_read(struct mii_bus *bus, int addr, int reg) static int rtl8366s_mii_write(struct mii_bus *bus, int addr, int reg, u16 val) { - struct rtl8366s *rtl = smi_to_rtl8366s(bus->priv); + struct rtl8366_smi *smi = bus->priv; u32 t; int err; - err = rtl8366s_write_phy_reg(rtl, addr, 0, reg, val); + err = rtl8366s_write_phy_reg(smi, addr, 0, reg, val); /* flush write */ - (void) rtl8366s_read_phy_reg(rtl, addr, 0, reg, &t); + (void) rtl8366s_read_phy_reg(smi, addr, 0, reg, &t); return err; } |