aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6352.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/dsa/mv88e6352.c')
-rw-r--r--drivers/net/dsa/mv88e6352.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/dsa/mv88e6352.c b/drivers/net/dsa/mv88e6352.c
index 258d9ef5ef25..e13adc7b3dda 100644
--- a/drivers/net/dsa/mv88e6352.c
+++ b/drivers/net/dsa/mv88e6352.c
@@ -22,17 +22,14 @@
22#include <net/dsa.h> 22#include <net/dsa.h>
23#include "mv88e6xxx.h" 23#include "mv88e6xxx.h"
24 24
25static int mv88e6352_wait(struct dsa_switch *ds, int reg, u16 mask) 25static int mv88e6352_wait(struct dsa_switch *ds, int reg, int offset, u16 mask)
26{ 26{
27 unsigned long timeout = jiffies + HZ / 10; 27 unsigned long timeout = jiffies + HZ / 10;
28 28
29 while (time_before(jiffies, timeout)) { 29 while (time_before(jiffies, timeout)) {
30 int ret; 30 int ret;
31 31
32 ret = REG_READ(REG_GLOBAL2, reg); 32 ret = REG_READ(reg, offset);
33 if (ret < 0)
34 return ret;
35
36 if (!(ret & mask)) 33 if (!(ret & mask))
37 return 0; 34 return 0;
38 35
@@ -43,17 +40,17 @@ static int mv88e6352_wait(struct dsa_switch *ds, int reg, u16 mask)
43 40
44static inline int mv88e6352_phy_wait(struct dsa_switch *ds) 41static inline int mv88e6352_phy_wait(struct dsa_switch *ds)
45{ 42{
46 return mv88e6352_wait(ds, 0x18, 0x8000); 43 return mv88e6352_wait(ds, REG_GLOBAL2, 0x18, 0x8000);
47} 44}
48 45
49static inline int mv88e6352_eeprom_load_wait(struct dsa_switch *ds) 46static inline int mv88e6352_eeprom_load_wait(struct dsa_switch *ds)
50{ 47{
51 return mv88e6352_wait(ds, 0x14, 0x0800); 48 return mv88e6352_wait(ds, REG_GLOBAL2, 0x14, 0x0800);
52} 49}
53 50
54static inline int mv88e6352_eeprom_busy_wait(struct dsa_switch *ds) 51static inline int mv88e6352_eeprom_busy_wait(struct dsa_switch *ds)
55{ 52{
56 return mv88e6352_wait(ds, 0x14, 0x8000); 53 return mv88e6352_wait(ds, REG_GLOBAL2, 0x14, 0x8000);
57} 54}
58 55
59static int __mv88e6352_phy_read(struct dsa_switch *ds, int addr, int regnum) 56static int __mv88e6352_phy_read(struct dsa_switch *ds, int addr, int regnum)