diff options
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index 17314ed9456d..9ce2146346b6 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c | |||
@@ -74,7 +74,7 @@ int __mv88e6xxx_reg_read(struct mii_bus *bus, int sw_addr, int addr, int reg) | |||
74 | 74 | ||
75 | int mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg) | 75 | int mv88e6xxx_reg_read(struct dsa_switch *ds, int addr, int reg) |
76 | { | 76 | { |
77 | struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); | 77 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
78 | int ret; | 78 | int ret; |
79 | 79 | ||
80 | mutex_lock(&ps->smi_mutex); | 80 | mutex_lock(&ps->smi_mutex); |
@@ -118,7 +118,7 @@ int __mv88e6xxx_reg_write(struct mii_bus *bus, int sw_addr, int addr, | |||
118 | 118 | ||
119 | int mv88e6xxx_reg_write(struct dsa_switch *ds, int addr, int reg, u16 val) | 119 | int mv88e6xxx_reg_write(struct dsa_switch *ds, int addr, int reg, u16 val) |
120 | { | 120 | { |
121 | struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); | 121 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
122 | int ret; | 122 | int ret; |
123 | 123 | ||
124 | mutex_lock(&ps->smi_mutex); | 124 | mutex_lock(&ps->smi_mutex); |
@@ -256,7 +256,7 @@ static void mv88e6xxx_ppu_reenable_timer(unsigned long _ps) | |||
256 | 256 | ||
257 | static int mv88e6xxx_ppu_access_get(struct dsa_switch *ds) | 257 | static int mv88e6xxx_ppu_access_get(struct dsa_switch *ds) |
258 | { | 258 | { |
259 | struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); | 259 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
260 | int ret; | 260 | int ret; |
261 | 261 | ||
262 | mutex_lock(&ps->ppu_mutex); | 262 | mutex_lock(&ps->ppu_mutex); |
@@ -283,7 +283,7 @@ static int mv88e6xxx_ppu_access_get(struct dsa_switch *ds) | |||
283 | 283 | ||
284 | static void mv88e6xxx_ppu_access_put(struct dsa_switch *ds) | 284 | static void mv88e6xxx_ppu_access_put(struct dsa_switch *ds) |
285 | { | 285 | { |
286 | struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); | 286 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
287 | 287 | ||
288 | /* Schedule a timer to re-enable the PHY polling unit. */ | 288 | /* Schedule a timer to re-enable the PHY polling unit. */ |
289 | mod_timer(&ps->ppu_timer, jiffies + msecs_to_jiffies(10)); | 289 | mod_timer(&ps->ppu_timer, jiffies + msecs_to_jiffies(10)); |
@@ -292,7 +292,7 @@ static void mv88e6xxx_ppu_access_put(struct dsa_switch *ds) | |||
292 | 292 | ||
293 | void mv88e6xxx_ppu_state_init(struct dsa_switch *ds) | 293 | void mv88e6xxx_ppu_state_init(struct dsa_switch *ds) |
294 | { | 294 | { |
295 | struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); | 295 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
296 | 296 | ||
297 | mutex_init(&ps->ppu_mutex); | 297 | mutex_init(&ps->ppu_mutex); |
298 | INIT_WORK(&ps->ppu_work, mv88e6xxx_ppu_reenable_work); | 298 | INIT_WORK(&ps->ppu_work, mv88e6xxx_ppu_reenable_work); |
@@ -463,7 +463,7 @@ void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, | |||
463 | int nr_stats, struct mv88e6xxx_hw_stat *stats, | 463 | int nr_stats, struct mv88e6xxx_hw_stat *stats, |
464 | int port, uint64_t *data) | 464 | int port, uint64_t *data) |
465 | { | 465 | { |
466 | struct mv88e6xxx_priv_state *ps = (void *)(ds + 1); | 466 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
467 | int ret; | 467 | int ret; |
468 | int i; | 468 | int i; |
469 | 469 | ||