diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2016-08-23 12:38:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-25 00:45:39 -0400 |
commit | 9d490b4ee4d7d495a4f4908ea998d2a7355e0807 (patch) | |
tree | cb628c4a13aa0c6140d1eef84b64af7059659398 /net/dsa/slave.c | |
parent | c7b7b483ccc9d64ae577a04d490aa9a975afe891 (diff) |
net: dsa: rename switch operations structure
Now that the dsa_switch_driver structure contains only function pointers
as it is supposed to, rename it to the more appropriate dsa_switch_ops,
uniformly to any other operations structure in the kernel.
No functional changes here, basically just the result of something like:
s/dsa_switch_driver *drv/dsa_switch_ops *ops/g
However keep the {un,}register_switch_driver functions and their
dsa_switch_drivers list as is, since they represent the -- likely to be
deprecated soon -- legacy DSA registration framework.
In the meantime, also fix the following checks from checkpatch.pl to
make it happy with this patch:
CHECK: Comparison to NULL could be written "!ops"
#403: FILE: net/dsa/dsa.c:470:
+ if (ops == NULL) {
CHECK: Comparison to NULL could be written "ds->ops->get_strings"
#773: FILE: net/dsa/slave.c:697:
+ if (ds->ops->get_strings != NULL)
CHECK: Comparison to NULL could be written "ds->ops->get_ethtool_stats"
#824: FILE: net/dsa/slave.c:785:
+ if (ds->ops->get_ethtool_stats != NULL)
CHECK: Comparison to NULL could be written "ds->ops->get_sset_count"
#835: FILE: net/dsa/slave.c:798:
+ if (ds->ops->get_sset_count != NULL)
total: 0 errors, 0 warnings, 4 checks, 784 lines checked
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r-- | net/dsa/slave.c | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index fc9196745225..9f6c2a20f6ff 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -28,7 +28,7 @@ static int dsa_slave_phy_read(struct mii_bus *bus, int addr, int reg) | |||
28 | struct dsa_switch *ds = bus->priv; | 28 | struct dsa_switch *ds = bus->priv; |
29 | 29 | ||
30 | if (ds->phys_mii_mask & (1 << addr)) | 30 | if (ds->phys_mii_mask & (1 << addr)) |
31 | return ds->drv->phy_read(ds, addr, reg); | 31 | return ds->ops->phy_read(ds, addr, reg); |
32 | 32 | ||
33 | return 0xffff; | 33 | return 0xffff; |
34 | } | 34 | } |
@@ -38,7 +38,7 @@ static int dsa_slave_phy_write(struct mii_bus *bus, int addr, int reg, u16 val) | |||
38 | struct dsa_switch *ds = bus->priv; | 38 | struct dsa_switch *ds = bus->priv; |
39 | 39 | ||
40 | if (ds->phys_mii_mask & (1 << addr)) | 40 | if (ds->phys_mii_mask & (1 << addr)) |
41 | return ds->drv->phy_write(ds, addr, reg, val); | 41 | return ds->ops->phy_write(ds, addr, reg, val); |
42 | 42 | ||
43 | return 0; | 43 | return 0; |
44 | } | 44 | } |
@@ -98,14 +98,14 @@ static int dsa_slave_open(struct net_device *dev) | |||
98 | goto clear_allmulti; | 98 | goto clear_allmulti; |
99 | } | 99 | } |
100 | 100 | ||
101 | if (ds->drv->port_enable) { | 101 | if (ds->ops->port_enable) { |
102 | err = ds->drv->port_enable(ds, p->port, p->phy); | 102 | err = ds->ops->port_enable(ds, p->port, p->phy); |
103 | if (err) | 103 | if (err) |
104 | goto clear_promisc; | 104 | goto clear_promisc; |
105 | } | 105 | } |
106 | 106 | ||
107 | if (ds->drv->port_stp_state_set) | 107 | if (ds->ops->port_stp_state_set) |
108 | ds->drv->port_stp_state_set(ds, p->port, stp_state); | 108 | ds->ops->port_stp_state_set(ds, p->port, stp_state); |
109 | 109 | ||
110 | if (p->phy) | 110 | if (p->phy) |
111 | phy_start(p->phy); | 111 | phy_start(p->phy); |
@@ -144,11 +144,11 @@ static int dsa_slave_close(struct net_device *dev) | |||
144 | if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) | 144 | if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) |
145 | dev_uc_del(master, dev->dev_addr); | 145 | dev_uc_del(master, dev->dev_addr); |
146 | 146 | ||
147 | if (ds->drv->port_disable) | 147 | if (ds->ops->port_disable) |
148 | ds->drv->port_disable(ds, p->port, p->phy); | 148 | ds->ops->port_disable(ds, p->port, p->phy); |
149 | 149 | ||
150 | if (ds->drv->port_stp_state_set) | 150 | if (ds->ops->port_stp_state_set) |
151 | ds->drv->port_stp_state_set(ds, p->port, BR_STATE_DISABLED); | 151 | ds->ops->port_stp_state_set(ds, p->port, BR_STATE_DISABLED); |
152 | 152 | ||
153 | return 0; | 153 | return 0; |
154 | } | 154 | } |
@@ -209,13 +209,13 @@ static int dsa_slave_port_vlan_add(struct net_device *dev, | |||
209 | struct dsa_switch *ds = p->parent; | 209 | struct dsa_switch *ds = p->parent; |
210 | 210 | ||
211 | if (switchdev_trans_ph_prepare(trans)) { | 211 | if (switchdev_trans_ph_prepare(trans)) { |
212 | if (!ds->drv->port_vlan_prepare || !ds->drv->port_vlan_add) | 212 | if (!ds->ops->port_vlan_prepare || !ds->ops->port_vlan_add) |
213 | return -EOPNOTSUPP; | 213 | return -EOPNOTSUPP; |
214 | 214 | ||
215 | return ds->drv->port_vlan_prepare(ds, p->port, vlan, trans); | 215 | return ds->ops->port_vlan_prepare(ds, p->port, vlan, trans); |
216 | } | 216 | } |
217 | 217 | ||
218 | ds->drv->port_vlan_add(ds, p->port, vlan, trans); | 218 | ds->ops->port_vlan_add(ds, p->port, vlan, trans); |
219 | 219 | ||
220 | return 0; | 220 | return 0; |
221 | } | 221 | } |
@@ -226,10 +226,10 @@ static int dsa_slave_port_vlan_del(struct net_device *dev, | |||
226 | struct dsa_slave_priv *p = netdev_priv(dev); | 226 | struct dsa_slave_priv *p = netdev_priv(dev); |
227 | struct dsa_switch *ds = p->parent; | 227 | struct dsa_switch *ds = p->parent; |
228 | 228 | ||
229 | if (!ds->drv->port_vlan_del) | 229 | if (!ds->ops->port_vlan_del) |
230 | return -EOPNOTSUPP; | 230 | return -EOPNOTSUPP; |
231 | 231 | ||
232 | return ds->drv->port_vlan_del(ds, p->port, vlan); | 232 | return ds->ops->port_vlan_del(ds, p->port, vlan); |
233 | } | 233 | } |
234 | 234 | ||
235 | static int dsa_slave_port_vlan_dump(struct net_device *dev, | 235 | static int dsa_slave_port_vlan_dump(struct net_device *dev, |
@@ -239,8 +239,8 @@ static int dsa_slave_port_vlan_dump(struct net_device *dev, | |||
239 | struct dsa_slave_priv *p = netdev_priv(dev); | 239 | struct dsa_slave_priv *p = netdev_priv(dev); |
240 | struct dsa_switch *ds = p->parent; | 240 | struct dsa_switch *ds = p->parent; |
241 | 241 | ||
242 | if (ds->drv->port_vlan_dump) | 242 | if (ds->ops->port_vlan_dump) |
243 | return ds->drv->port_vlan_dump(ds, p->port, vlan, cb); | 243 | return ds->ops->port_vlan_dump(ds, p->port, vlan, cb); |
244 | 244 | ||
245 | return -EOPNOTSUPP; | 245 | return -EOPNOTSUPP; |
246 | } | 246 | } |
@@ -253,13 +253,13 @@ static int dsa_slave_port_fdb_add(struct net_device *dev, | |||
253 | struct dsa_switch *ds = p->parent; | 253 | struct dsa_switch *ds = p->parent; |
254 | 254 | ||
255 | if (switchdev_trans_ph_prepare(trans)) { | 255 | if (switchdev_trans_ph_prepare(trans)) { |
256 | if (!ds->drv->port_fdb_prepare || !ds->drv->port_fdb_add) | 256 | if (!ds->ops->port_fdb_prepare || !ds->ops->port_fdb_add) |
257 | return -EOPNOTSUPP; | 257 | return -EOPNOTSUPP; |
258 | 258 | ||
259 | return ds->drv->port_fdb_prepare(ds, p->port, fdb, trans); | 259 | return ds->ops->port_fdb_prepare(ds, p->port, fdb, trans); |
260 | } | 260 | } |
261 | 261 | ||
262 | ds->drv->port_fdb_add(ds, p->port, fdb, trans); | 262 | ds->ops->port_fdb_add(ds, p->port, fdb, trans); |
263 | 263 | ||
264 | return 0; | 264 | return 0; |
265 | } | 265 | } |
@@ -271,8 +271,8 @@ static int dsa_slave_port_fdb_del(struct net_device *dev, | |||
271 | struct dsa_switch *ds = p->parent; | 271 | struct dsa_switch *ds = p->parent; |
272 | int ret = -EOPNOTSUPP; | 272 | int ret = -EOPNOTSUPP; |
273 | 273 | ||
274 | if (ds->drv->port_fdb_del) | 274 | if (ds->ops->port_fdb_del) |
275 | ret = ds->drv->port_fdb_del(ds, p->port, fdb); | 275 | ret = ds->ops->port_fdb_del(ds, p->port, fdb); |
276 | 276 | ||
277 | return ret; | 277 | return ret; |
278 | } | 278 | } |
@@ -284,8 +284,8 @@ static int dsa_slave_port_fdb_dump(struct net_device *dev, | |||
284 | struct dsa_slave_priv *p = netdev_priv(dev); | 284 | struct dsa_slave_priv *p = netdev_priv(dev); |
285 | struct dsa_switch *ds = p->parent; | 285 | struct dsa_switch *ds = p->parent; |
286 | 286 | ||
287 | if (ds->drv->port_fdb_dump) | 287 | if (ds->ops->port_fdb_dump) |
288 | return ds->drv->port_fdb_dump(ds, p->port, fdb, cb); | 288 | return ds->ops->port_fdb_dump(ds, p->port, fdb, cb); |
289 | 289 | ||
290 | return -EOPNOTSUPP; | 290 | return -EOPNOTSUPP; |
291 | } | 291 | } |
@@ -308,9 +308,9 @@ static int dsa_slave_stp_state_set(struct net_device *dev, | |||
308 | struct dsa_switch *ds = p->parent; | 308 | struct dsa_switch *ds = p->parent; |
309 | 309 | ||
310 | if (switchdev_trans_ph_prepare(trans)) | 310 | if (switchdev_trans_ph_prepare(trans)) |
311 | return ds->drv->port_stp_state_set ? 0 : -EOPNOTSUPP; | 311 | return ds->ops->port_stp_state_set ? 0 : -EOPNOTSUPP; |
312 | 312 | ||
313 | ds->drv->port_stp_state_set(ds, p->port, attr->u.stp_state); | 313 | ds->ops->port_stp_state_set(ds, p->port, attr->u.stp_state); |
314 | 314 | ||
315 | return 0; | 315 | return 0; |
316 | } | 316 | } |
@@ -326,8 +326,8 @@ static int dsa_slave_vlan_filtering(struct net_device *dev, | |||
326 | if (switchdev_trans_ph_prepare(trans)) | 326 | if (switchdev_trans_ph_prepare(trans)) |
327 | return 0; | 327 | return 0; |
328 | 328 | ||
329 | if (ds->drv->port_vlan_filtering) | 329 | if (ds->ops->port_vlan_filtering) |
330 | return ds->drv->port_vlan_filtering(ds, p->port, | 330 | return ds->ops->port_vlan_filtering(ds, p->port, |
331 | attr->u.vlan_filtering); | 331 | attr->u.vlan_filtering); |
332 | 332 | ||
333 | return 0; | 333 | return 0; |
@@ -365,8 +365,8 @@ static int dsa_slave_ageing_time(struct net_device *dev, | |||
365 | ds->ports[p->port].ageing_time = ageing_time; | 365 | ds->ports[p->port].ageing_time = ageing_time; |
366 | ageing_time = dsa_fastest_ageing_time(ds, ageing_time); | 366 | ageing_time = dsa_fastest_ageing_time(ds, ageing_time); |
367 | 367 | ||
368 | if (ds->drv->set_ageing_time) | 368 | if (ds->ops->set_ageing_time) |
369 | return ds->drv->set_ageing_time(ds, ageing_time); | 369 | return ds->ops->set_ageing_time(ds, ageing_time); |
370 | 370 | ||
371 | return 0; | 371 | return 0; |
372 | } | 372 | } |
@@ -481,8 +481,8 @@ static int dsa_slave_bridge_port_join(struct net_device *dev, | |||
481 | 481 | ||
482 | p->bridge_dev = br; | 482 | p->bridge_dev = br; |
483 | 483 | ||
484 | if (ds->drv->port_bridge_join) | 484 | if (ds->ops->port_bridge_join) |
485 | ret = ds->drv->port_bridge_join(ds, p->port, br); | 485 | ret = ds->ops->port_bridge_join(ds, p->port, br); |
486 | 486 | ||
487 | return ret == -EOPNOTSUPP ? 0 : ret; | 487 | return ret == -EOPNOTSUPP ? 0 : ret; |
488 | } | 488 | } |
@@ -493,16 +493,16 @@ static void dsa_slave_bridge_port_leave(struct net_device *dev) | |||
493 | struct dsa_switch *ds = p->parent; | 493 | struct dsa_switch *ds = p->parent; |
494 | 494 | ||
495 | 495 | ||
496 | if (ds->drv->port_bridge_leave) | 496 | if (ds->ops->port_bridge_leave) |
497 | ds->drv->port_bridge_leave(ds, p->port); | 497 | ds->ops->port_bridge_leave(ds, p->port); |
498 | 498 | ||
499 | p->bridge_dev = NULL; | 499 | p->bridge_dev = NULL; |
500 | 500 | ||
501 | /* Port left the bridge, put in BR_STATE_DISABLED by the bridge layer, | 501 | /* Port left the bridge, put in BR_STATE_DISABLED by the bridge layer, |
502 | * so allow it to be in BR_STATE_FORWARDING to be kept functional | 502 | * so allow it to be in BR_STATE_FORWARDING to be kept functional |
503 | */ | 503 | */ |
504 | if (ds->drv->port_stp_state_set) | 504 | if (ds->ops->port_stp_state_set) |
505 | ds->drv->port_stp_state_set(ds, p->port, BR_STATE_FORWARDING); | 505 | ds->ops->port_stp_state_set(ds, p->port, BR_STATE_FORWARDING); |
506 | } | 506 | } |
507 | 507 | ||
508 | static int dsa_slave_port_attr_get(struct net_device *dev, | 508 | static int dsa_slave_port_attr_get(struct net_device *dev, |
@@ -605,8 +605,8 @@ static int dsa_slave_get_regs_len(struct net_device *dev) | |||
605 | struct dsa_slave_priv *p = netdev_priv(dev); | 605 | struct dsa_slave_priv *p = netdev_priv(dev); |
606 | struct dsa_switch *ds = p->parent; | 606 | struct dsa_switch *ds = p->parent; |
607 | 607 | ||
608 | if (ds->drv->get_regs_len) | 608 | if (ds->ops->get_regs_len) |
609 | return ds->drv->get_regs_len(ds, p->port); | 609 | return ds->ops->get_regs_len(ds, p->port); |
610 | 610 | ||
611 | return -EOPNOTSUPP; | 611 | return -EOPNOTSUPP; |
612 | } | 612 | } |
@@ -617,8 +617,8 @@ dsa_slave_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *_p) | |||
617 | struct dsa_slave_priv *p = netdev_priv(dev); | 617 | struct dsa_slave_priv *p = netdev_priv(dev); |
618 | struct dsa_switch *ds = p->parent; | 618 | struct dsa_switch *ds = p->parent; |
619 | 619 | ||
620 | if (ds->drv->get_regs) | 620 | if (ds->ops->get_regs) |
621 | ds->drv->get_regs(ds, p->port, regs, _p); | 621 | ds->ops->get_regs(ds, p->port, regs, _p); |
622 | } | 622 | } |
623 | 623 | ||
624 | static int dsa_slave_nway_reset(struct net_device *dev) | 624 | static int dsa_slave_nway_reset(struct net_device *dev) |
@@ -651,8 +651,8 @@ static int dsa_slave_get_eeprom_len(struct net_device *dev) | |||
651 | if (ds->cd && ds->cd->eeprom_len) | 651 | if (ds->cd && ds->cd->eeprom_len) |
652 | return ds->cd->eeprom_len; | 652 | return ds->cd->eeprom_len; |
653 | 653 | ||
654 | if (ds->drv->get_eeprom_len) | 654 | if (ds->ops->get_eeprom_len) |
655 | return ds->drv->get_eeprom_len(ds); | 655 | return ds->ops->get_eeprom_len(ds); |
656 | 656 | ||
657 | return 0; | 657 | return 0; |
658 | } | 658 | } |
@@ -663,8 +663,8 @@ static int dsa_slave_get_eeprom(struct net_device *dev, | |||
663 | struct dsa_slave_priv *p = netdev_priv(dev); | 663 | struct dsa_slave_priv *p = netdev_priv(dev); |
664 | struct dsa_switch *ds = p->parent; | 664 | struct dsa_switch *ds = p->parent; |
665 | 665 | ||
666 | if (ds->drv->get_eeprom) | 666 | if (ds->ops->get_eeprom) |
667 | return ds->drv->get_eeprom(ds, eeprom, data); | 667 | return ds->ops->get_eeprom(ds, eeprom, data); |
668 | 668 | ||
669 | return -EOPNOTSUPP; | 669 | return -EOPNOTSUPP; |
670 | } | 670 | } |
@@ -675,8 +675,8 @@ static int dsa_slave_set_eeprom(struct net_device *dev, | |||
675 | struct dsa_slave_priv *p = netdev_priv(dev); | 675 | struct dsa_slave_priv *p = netdev_priv(dev); |
676 | struct dsa_switch *ds = p->parent; | 676 | struct dsa_switch *ds = p->parent; |
677 | 677 | ||
678 | if (ds->drv->set_eeprom) | 678 | if (ds->ops->set_eeprom) |
679 | return ds->drv->set_eeprom(ds, eeprom, data); | 679 | return ds->ops->set_eeprom(ds, eeprom, data); |
680 | 680 | ||
681 | return -EOPNOTSUPP; | 681 | return -EOPNOTSUPP; |
682 | } | 682 | } |
@@ -694,8 +694,8 @@ static void dsa_slave_get_strings(struct net_device *dev, | |||
694 | strncpy(data + len, "tx_bytes", len); | 694 | strncpy(data + len, "tx_bytes", len); |
695 | strncpy(data + 2 * len, "rx_packets", len); | 695 | strncpy(data + 2 * len, "rx_packets", len); |
696 | strncpy(data + 3 * len, "rx_bytes", len); | 696 | strncpy(data + 3 * len, "rx_bytes", len); |
697 | if (ds->drv->get_strings != NULL) | 697 | if (ds->ops->get_strings) |
698 | ds->drv->get_strings(ds, p->port, data + 4 * len); | 698 | ds->ops->get_strings(ds, p->port, data + 4 * len); |
699 | } | 699 | } |
700 | } | 700 | } |
701 | 701 | ||
@@ -714,8 +714,8 @@ static void dsa_cpu_port_get_ethtool_stats(struct net_device *dev, | |||
714 | dst->master_ethtool_ops.get_ethtool_stats(dev, stats, data); | 714 | dst->master_ethtool_ops.get_ethtool_stats(dev, stats, data); |
715 | } | 715 | } |
716 | 716 | ||
717 | if (ds->drv->get_ethtool_stats) | 717 | if (ds->ops->get_ethtool_stats) |
718 | ds->drv->get_ethtool_stats(ds, cpu_port, data + count); | 718 | ds->ops->get_ethtool_stats(ds, cpu_port, data + count); |
719 | } | 719 | } |
720 | 720 | ||
721 | static int dsa_cpu_port_get_sset_count(struct net_device *dev, int sset) | 721 | static int dsa_cpu_port_get_sset_count(struct net_device *dev, int sset) |
@@ -727,8 +727,8 @@ static int dsa_cpu_port_get_sset_count(struct net_device *dev, int sset) | |||
727 | if (dst->master_ethtool_ops.get_sset_count) | 727 | if (dst->master_ethtool_ops.get_sset_count) |
728 | count += dst->master_ethtool_ops.get_sset_count(dev, sset); | 728 | count += dst->master_ethtool_ops.get_sset_count(dev, sset); |
729 | 729 | ||
730 | if (sset == ETH_SS_STATS && ds->drv->get_sset_count) | 730 | if (sset == ETH_SS_STATS && ds->ops->get_sset_count) |
731 | count += ds->drv->get_sset_count(ds); | 731 | count += ds->ops->get_sset_count(ds); |
732 | 732 | ||
733 | return count; | 733 | return count; |
734 | } | 734 | } |
@@ -755,14 +755,14 @@ static void dsa_cpu_port_get_strings(struct net_device *dev, | |||
755 | dst->master_ethtool_ops.get_strings(dev, stringset, data); | 755 | dst->master_ethtool_ops.get_strings(dev, stringset, data); |
756 | } | 756 | } |
757 | 757 | ||
758 | if (stringset == ETH_SS_STATS && ds->drv->get_strings) { | 758 | if (stringset == ETH_SS_STATS && ds->ops->get_strings) { |
759 | ndata = data + mcount * len; | 759 | ndata = data + mcount * len; |
760 | /* This function copies ETH_GSTRINGS_LEN bytes, we will mangle | 760 | /* This function copies ETH_GSTRINGS_LEN bytes, we will mangle |
761 | * the output after to prepend our CPU port prefix we | 761 | * the output after to prepend our CPU port prefix we |
762 | * constructed earlier | 762 | * constructed earlier |
763 | */ | 763 | */ |
764 | ds->drv->get_strings(ds, cpu_port, ndata); | 764 | ds->ops->get_strings(ds, cpu_port, ndata); |
765 | count = ds->drv->get_sset_count(ds); | 765 | count = ds->ops->get_sset_count(ds); |
766 | for (i = 0; i < count; i++) { | 766 | for (i = 0; i < count; i++) { |
767 | memmove(ndata + (i * len + sizeof(pfx)), | 767 | memmove(ndata + (i * len + sizeof(pfx)), |
768 | ndata + i * len, len - sizeof(pfx)); | 768 | ndata + i * len, len - sizeof(pfx)); |
@@ -782,8 +782,8 @@ static void dsa_slave_get_ethtool_stats(struct net_device *dev, | |||
782 | data[1] = dev->stats.tx_bytes; | 782 | data[1] = dev->stats.tx_bytes; |
783 | data[2] = dev->stats.rx_packets; | 783 | data[2] = dev->stats.rx_packets; |
784 | data[3] = dev->stats.rx_bytes; | 784 | data[3] = dev->stats.rx_bytes; |
785 | if (ds->drv->get_ethtool_stats != NULL) | 785 | if (ds->ops->get_ethtool_stats) |
786 | ds->drv->get_ethtool_stats(ds, p->port, data + 4); | 786 | ds->ops->get_ethtool_stats(ds, p->port, data + 4); |
787 | } | 787 | } |
788 | 788 | ||
789 | static int dsa_slave_get_sset_count(struct net_device *dev, int sset) | 789 | static int dsa_slave_get_sset_count(struct net_device *dev, int sset) |
@@ -795,8 +795,8 @@ static int dsa_slave_get_sset_count(struct net_device *dev, int sset) | |||
795 | int count; | 795 | int count; |
796 | 796 | ||
797 | count = 4; | 797 | count = 4; |
798 | if (ds->drv->get_sset_count != NULL) | 798 | if (ds->ops->get_sset_count) |
799 | count += ds->drv->get_sset_count(ds); | 799 | count += ds->ops->get_sset_count(ds); |
800 | 800 | ||
801 | return count; | 801 | return count; |
802 | } | 802 | } |
@@ -809,8 +809,8 @@ static void dsa_slave_get_wol(struct net_device *dev, struct ethtool_wolinfo *w) | |||
809 | struct dsa_slave_priv *p = netdev_priv(dev); | 809 | struct dsa_slave_priv *p = netdev_priv(dev); |
810 | struct dsa_switch *ds = p->parent; | 810 | struct dsa_switch *ds = p->parent; |
811 | 811 | ||
812 | if (ds->drv->get_wol) | 812 | if (ds->ops->get_wol) |
813 | ds->drv->get_wol(ds, p->port, w); | 813 | ds->ops->get_wol(ds, p->port, w); |
814 | } | 814 | } |
815 | 815 | ||
816 | static int dsa_slave_set_wol(struct net_device *dev, struct ethtool_wolinfo *w) | 816 | static int dsa_slave_set_wol(struct net_device *dev, struct ethtool_wolinfo *w) |
@@ -819,8 +819,8 @@ static int dsa_slave_set_wol(struct net_device *dev, struct ethtool_wolinfo *w) | |||
819 | struct dsa_switch *ds = p->parent; | 819 | struct dsa_switch *ds = p->parent; |
820 | int ret = -EOPNOTSUPP; | 820 | int ret = -EOPNOTSUPP; |
821 | 821 | ||
822 | if (ds->drv->set_wol) | 822 | if (ds->ops->set_wol) |
823 | ret = ds->drv->set_wol(ds, p->port, w); | 823 | ret = ds->ops->set_wol(ds, p->port, w); |
824 | 824 | ||
825 | return ret; | 825 | return ret; |
826 | } | 826 | } |
@@ -831,10 +831,10 @@ static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e) | |||
831 | struct dsa_switch *ds = p->parent; | 831 | struct dsa_switch *ds = p->parent; |
832 | int ret; | 832 | int ret; |
833 | 833 | ||
834 | if (!ds->drv->set_eee) | 834 | if (!ds->ops->set_eee) |
835 | return -EOPNOTSUPP; | 835 | return -EOPNOTSUPP; |
836 | 836 | ||
837 | ret = ds->drv->set_eee(ds, p->port, p->phy, e); | 837 | ret = ds->ops->set_eee(ds, p->port, p->phy, e); |
838 | if (ret) | 838 | if (ret) |
839 | return ret; | 839 | return ret; |
840 | 840 | ||
@@ -850,10 +850,10 @@ static int dsa_slave_get_eee(struct net_device *dev, struct ethtool_eee *e) | |||
850 | struct dsa_switch *ds = p->parent; | 850 | struct dsa_switch *ds = p->parent; |
851 | int ret; | 851 | int ret; |
852 | 852 | ||
853 | if (!ds->drv->get_eee) | 853 | if (!ds->ops->get_eee) |
854 | return -EOPNOTSUPP; | 854 | return -EOPNOTSUPP; |
855 | 855 | ||
856 | ret = ds->drv->get_eee(ds, p->port, e); | 856 | ret = ds->ops->get_eee(ds, p->port, e); |
857 | if (ret) | 857 | if (ret) |
858 | return ret; | 858 | return ret; |
859 | 859 | ||
@@ -988,8 +988,8 @@ static void dsa_slave_adjust_link(struct net_device *dev) | |||
988 | p->old_pause = p->phy->pause; | 988 | p->old_pause = p->phy->pause; |
989 | } | 989 | } |
990 | 990 | ||
991 | if (ds->drv->adjust_link && status_changed) | 991 | if (ds->ops->adjust_link && status_changed) |
992 | ds->drv->adjust_link(ds, p->port, p->phy); | 992 | ds->ops->adjust_link(ds, p->port, p->phy); |
993 | 993 | ||
994 | if (status_changed) | 994 | if (status_changed) |
995 | phy_print_status(p->phy); | 995 | phy_print_status(p->phy); |
@@ -1004,8 +1004,8 @@ static int dsa_slave_fixed_link_update(struct net_device *dev, | |||
1004 | if (dev) { | 1004 | if (dev) { |
1005 | p = netdev_priv(dev); | 1005 | p = netdev_priv(dev); |
1006 | ds = p->parent; | 1006 | ds = p->parent; |
1007 | if (ds->drv->fixed_link_update) | 1007 | if (ds->ops->fixed_link_update) |
1008 | ds->drv->fixed_link_update(ds, p->port, status); | 1008 | ds->ops->fixed_link_update(ds, p->port, status); |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | return 0; | 1011 | return 0; |
@@ -1062,8 +1062,8 @@ static int dsa_slave_phy_setup(struct dsa_slave_priv *p, | |||
1062 | phy_dn = port_dn; | 1062 | phy_dn = port_dn; |
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | if (ds->drv->get_phy_flags) | 1065 | if (ds->ops->get_phy_flags) |
1066 | phy_flags = ds->drv->get_phy_flags(ds, p->port); | 1066 | phy_flags = ds->ops->get_phy_flags(ds, p->port); |
1067 | 1067 | ||
1068 | if (phy_dn) { | 1068 | if (phy_dn) { |
1069 | int phy_id = of_mdio_parse_addr(&slave_dev->dev, phy_dn); | 1069 | int phy_id = of_mdio_parse_addr(&slave_dev->dev, phy_dn); |