Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: remove ds_to_priv

Access the priv member of the dsa_switch structure directly, instead of
having an unnecessary helper.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vivien Didelot and committed by
David S. Miller
04bed143 278ed676

+60 -65
+21 -21
drivers/net/dsa/b53/b53_common.c
··· 477 477 478 478 static void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port) 479 479 { 480 - struct b53_device *dev = ds_to_priv(ds); 480 + struct b53_device *dev = ds->priv; 481 481 unsigned int i; 482 482 u16 pvlan; 483 483 ··· 495 495 static int b53_enable_port(struct dsa_switch *ds, int port, 496 496 struct phy_device *phy) 497 497 { 498 - struct b53_device *dev = ds_to_priv(ds); 498 + struct b53_device *dev = ds->priv; 499 499 unsigned int cpu_port = dev->cpu_port; 500 500 u16 pvlan; 501 501 ··· 520 520 static void b53_disable_port(struct dsa_switch *ds, int port, 521 521 struct phy_device *phy) 522 522 { 523 - struct b53_device *dev = ds_to_priv(ds); 523 + struct b53_device *dev = ds->priv; 524 524 u8 reg; 525 525 526 526 /* Disable Tx/Rx for the port */ ··· 629 629 630 630 static int b53_phy_read16(struct dsa_switch *ds, int addr, int reg) 631 631 { 632 - struct b53_device *priv = ds_to_priv(ds); 632 + struct b53_device *priv = ds->priv; 633 633 u16 value = 0; 634 634 int ret; 635 635 ··· 644 644 645 645 static int b53_phy_write16(struct dsa_switch *ds, int addr, int reg, u16 val) 646 646 { 647 - struct b53_device *priv = ds_to_priv(ds); 647 + struct b53_device *priv = ds->priv; 648 648 649 649 if (priv->ops->phy_write16) 650 650 return priv->ops->phy_write16(priv, addr, reg, val); ··· 714 714 715 715 static void b53_get_strings(struct dsa_switch *ds, int port, uint8_t *data) 716 716 { 717 - struct b53_device *dev = ds_to_priv(ds); 717 + struct b53_device *dev = ds->priv; 718 718 const struct b53_mib_desc *mibs = b53_get_mib(dev); 719 719 unsigned int mib_size = b53_get_mib_size(dev); 720 720 unsigned int i; ··· 727 727 static void b53_get_ethtool_stats(struct dsa_switch *ds, int port, 728 728 uint64_t *data) 729 729 { 730 - struct b53_device *dev = ds_to_priv(ds); 730 + struct b53_device *dev = ds->priv; 731 731 const struct b53_mib_desc *mibs = b53_get_mib(dev); 732 732 unsigned int mib_size = b53_get_mib_size(dev); 733 733 const struct b53_mib_desc *s; ··· 759 759 760 760 static int b53_get_sset_count(struct dsa_switch *ds) 761 761 { 762 - struct b53_device *dev = ds_to_priv(ds); 762 + struct b53_device *dev = ds->priv; 763 763 764 764 return b53_get_mib_size(dev); 765 765 } ··· 771 771 772 772 static int b53_setup(struct dsa_switch *ds) 773 773 { 774 - struct b53_device *dev = ds_to_priv(ds); 774 + struct b53_device *dev = ds->priv; 775 775 unsigned int port; 776 776 int ret; 777 777 ··· 802 802 static void b53_adjust_link(struct dsa_switch *ds, int port, 803 803 struct phy_device *phydev) 804 804 { 805 - struct b53_device *dev = ds_to_priv(ds); 805 + struct b53_device *dev = ds->priv; 806 806 u8 rgmii_ctrl = 0, reg = 0, off; 807 807 808 808 if (!phy_is_pseudo_fixed_link(phydev)) ··· 936 936 const struct switchdev_obj_port_vlan *vlan, 937 937 struct switchdev_trans *trans) 938 938 { 939 - struct b53_device *dev = ds_to_priv(ds); 939 + struct b53_device *dev = ds->priv; 940 940 941 941 if ((is5325(dev) || is5365(dev)) && vlan->vid_begin == 0) 942 942 return -EOPNOTSUPP; ··· 953 953 const struct switchdev_obj_port_vlan *vlan, 954 954 struct switchdev_trans *trans) 955 955 { 956 - struct b53_device *dev = ds_to_priv(ds); 956 + struct b53_device *dev = ds->priv; 957 957 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; 958 958 bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID; 959 959 unsigned int cpu_port = dev->cpu_port; ··· 987 987 static int b53_vlan_del(struct dsa_switch *ds, int port, 988 988 const struct switchdev_obj_port_vlan *vlan) 989 989 { 990 - struct b53_device *dev = ds_to_priv(ds); 990 + struct b53_device *dev = ds->priv; 991 991 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; 992 992 unsigned int cpu_port = dev->cpu_port; 993 993 struct b53_vlan *vl; ··· 1033 1033 struct switchdev_obj_port_vlan *vlan, 1034 1034 int (*cb)(struct switchdev_obj *obj)) 1035 1035 { 1036 - struct b53_device *dev = ds_to_priv(ds); 1036 + struct b53_device *dev = ds->priv; 1037 1037 u16 vid, vid_start = 0, pvid; 1038 1038 struct b53_vlan *vl; 1039 1039 int err = 0; ··· 1192 1192 const struct switchdev_obj_port_fdb *fdb, 1193 1193 struct switchdev_trans *trans) 1194 1194 { 1195 - struct b53_device *priv = ds_to_priv(ds); 1195 + struct b53_device *priv = ds->priv; 1196 1196 1197 1197 /* 5325 and 5365 require some more massaging, but could 1198 1198 * be supported eventually ··· 1207 1207 const struct switchdev_obj_port_fdb *fdb, 1208 1208 struct switchdev_trans *trans) 1209 1209 { 1210 - struct b53_device *priv = ds_to_priv(ds); 1210 + struct b53_device *priv = ds->priv; 1211 1211 1212 1212 if (b53_arl_op(priv, 0, port, fdb->addr, fdb->vid, true)) 1213 1213 pr_err("%s: failed to add MAC address\n", __func__); ··· 1216 1216 static int b53_fdb_del(struct dsa_switch *ds, int port, 1217 1217 const struct switchdev_obj_port_fdb *fdb) 1218 1218 { 1219 - struct b53_device *priv = ds_to_priv(ds); 1219 + struct b53_device *priv = ds->priv; 1220 1220 1221 1221 return b53_arl_op(priv, 0, port, fdb->addr, fdb->vid, false); 1222 1222 } ··· 1275 1275 struct switchdev_obj_port_fdb *fdb, 1276 1276 int (*cb)(struct switchdev_obj *obj)) 1277 1277 { 1278 - struct b53_device *priv = ds_to_priv(ds); 1278 + struct b53_device *priv = ds->priv; 1279 1279 struct net_device *dev = ds->ports[port].netdev; 1280 1280 struct b53_arl_entry results[2]; 1281 1281 unsigned int count = 0; ··· 1314 1314 static int b53_br_join(struct dsa_switch *ds, int port, 1315 1315 struct net_device *bridge) 1316 1316 { 1317 - struct b53_device *dev = ds_to_priv(ds); 1317 + struct b53_device *dev = ds->priv; 1318 1318 s8 cpu_port = ds->dst->cpu_port; 1319 1319 u16 pvlan, reg; 1320 1320 unsigned int i; ··· 1359 1359 1360 1360 static void b53_br_leave(struct dsa_switch *ds, int port) 1361 1361 { 1362 - struct b53_device *dev = ds_to_priv(ds); 1362 + struct b53_device *dev = ds->priv; 1363 1363 struct net_device *bridge = dev->ports[port].bridge_dev; 1364 1364 struct b53_vlan *vl = &dev->vlans[0]; 1365 1365 s8 cpu_port = ds->dst->cpu_port; ··· 1410 1410 static void b53_br_set_stp_state(struct dsa_switch *ds, int port, 1411 1411 u8 state) 1412 1412 { 1413 - struct b53_device *dev = ds_to_priv(ds); 1413 + struct b53_device *dev = ds->priv; 1414 1414 u8 hw_state, cur_hw_state; 1415 1415 u8 reg; 1416 1416
+1 -1
drivers/net/dsa/bcm_sf2.h
··· 101 101 102 102 static inline struct bcm_sf2_priv *bcm_sf2_to_priv(struct dsa_switch *ds) 103 103 { 104 - struct b53_device *dev = ds_to_priv(ds); 104 + struct b53_device *dev = ds->priv; 105 105 106 106 return dev->priv; 107 107 }
+2 -2
drivers/net/dsa/mv88e6060.c
··· 19 19 20 20 static int reg_read(struct dsa_switch *ds, int addr, int reg) 21 21 { 22 - struct mv88e6060_priv *priv = ds_to_priv(ds); 22 + struct mv88e6060_priv *priv = ds->priv; 23 23 24 24 return mdiobus_read_nested(priv->bus, priv->sw_addr + addr, reg); 25 25 } ··· 37 37 38 38 static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val) 39 39 { 40 - struct mv88e6060_priv *priv = ds_to_priv(ds); 40 + struct mv88e6060_priv *priv = ds->priv; 41 41 42 42 return mdiobus_write_nested(priv->bus, priv->sw_addr + addr, reg, val); 43 43 }
+36 -36
drivers/net/dsa/mv88e6xxx/chip.c
··· 586 586 static void mv88e6xxx_adjust_link(struct dsa_switch *ds, int port, 587 587 struct phy_device *phydev) 588 588 { 589 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 589 + struct mv88e6xxx_chip *chip = ds->priv; 590 590 u32 reg; 591 591 int ret; 592 592 ··· 832 832 static void mv88e6xxx_get_strings(struct dsa_switch *ds, int port, 833 833 uint8_t *data) 834 834 { 835 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 835 + struct mv88e6xxx_chip *chip = ds->priv; 836 836 struct mv88e6xxx_hw_stat *stat; 837 837 int i, j; 838 838 ··· 848 848 849 849 static int mv88e6xxx_get_sset_count(struct dsa_switch *ds) 850 850 { 851 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 851 + struct mv88e6xxx_chip *chip = ds->priv; 852 852 struct mv88e6xxx_hw_stat *stat; 853 853 int i, j; 854 854 ··· 863 863 static void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, int port, 864 864 uint64_t *data) 865 865 { 866 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 866 + struct mv88e6xxx_chip *chip = ds->priv; 867 867 struct mv88e6xxx_hw_stat *stat; 868 868 int ret; 869 869 int i, j; ··· 894 894 static void mv88e6xxx_get_regs(struct dsa_switch *ds, int port, 895 895 struct ethtool_regs *regs, void *_p) 896 896 { 897 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 897 + struct mv88e6xxx_chip *chip = ds->priv; 898 898 u16 *p = _p; 899 899 int i; 900 900 ··· 924 924 static int mv88e6xxx_get_eee(struct dsa_switch *ds, int port, 925 925 struct ethtool_eee *e) 926 926 { 927 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 927 + struct mv88e6xxx_chip *chip = ds->priv; 928 928 u16 reg; 929 929 int err; 930 930 ··· 954 954 static int mv88e6xxx_set_eee(struct dsa_switch *ds, int port, 955 955 struct phy_device *phydev, struct ethtool_eee *e) 956 956 { 957 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 957 + struct mv88e6xxx_chip *chip = ds->priv; 958 958 u16 reg; 959 959 int err; 960 960 ··· 1185 1185 static void mv88e6xxx_port_stp_state_set(struct dsa_switch *ds, int port, 1186 1186 u8 state) 1187 1187 { 1188 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 1188 + struct mv88e6xxx_chip *chip = ds->priv; 1189 1189 int stp_state; 1190 1190 int err; 1191 1191 ··· 1434 1434 struct switchdev_obj_port_vlan *vlan, 1435 1435 int (*cb)(struct switchdev_obj *obj)) 1436 1436 { 1437 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 1437 + struct mv88e6xxx_chip *chip = ds->priv; 1438 1438 struct mv88e6xxx_vtu_stu_entry next; 1439 1439 u16 pvid; 1440 1440 int err; ··· 1803 1803 static int mv88e6xxx_port_check_hw_vlan(struct dsa_switch *ds, int port, 1804 1804 u16 vid_begin, u16 vid_end) 1805 1805 { 1806 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 1806 + struct mv88e6xxx_chip *chip = ds->priv; 1807 1807 struct mv88e6xxx_vtu_stu_entry vlan; 1808 1808 int i, err; 1809 1809 ··· 1864 1864 static int mv88e6xxx_port_vlan_filtering(struct dsa_switch *ds, int port, 1865 1865 bool vlan_filtering) 1866 1866 { 1867 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 1867 + struct mv88e6xxx_chip *chip = ds->priv; 1868 1868 u16 old, new = vlan_filtering ? PORT_CONTROL_2_8021Q_SECURE : 1869 1869 PORT_CONTROL_2_8021Q_DISABLED; 1870 1870 int ret; ··· 1906 1906 const struct switchdev_obj_port_vlan *vlan, 1907 1907 struct switchdev_trans *trans) 1908 1908 { 1909 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 1909 + struct mv88e6xxx_chip *chip = ds->priv; 1910 1910 int err; 1911 1911 1912 1912 if (!mv88e6xxx_has(chip, MV88E6XXX_FLAG_VTU)) ··· 1947 1947 const struct switchdev_obj_port_vlan *vlan, 1948 1948 struct switchdev_trans *trans) 1949 1949 { 1950 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 1950 + struct mv88e6xxx_chip *chip = ds->priv; 1951 1951 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; 1952 1952 bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID; 1953 1953 u16 vid; ··· 2009 2009 static int mv88e6xxx_port_vlan_del(struct dsa_switch *ds, int port, 2010 2010 const struct switchdev_obj_port_vlan *vlan) 2011 2011 { 2012 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 2012 + struct mv88e6xxx_chip *chip = ds->priv; 2013 2013 u16 pvid, vid; 2014 2014 int err = 0; 2015 2015 ··· 2134 2134 const struct switchdev_obj_port_fdb *fdb, 2135 2135 struct switchdev_trans *trans) 2136 2136 { 2137 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 2137 + struct mv88e6xxx_chip *chip = ds->priv; 2138 2138 2139 2139 mutex_lock(&chip->reg_lock); 2140 2140 if (mv88e6xxx_port_db_load_purge(chip, port, fdb->addr, fdb->vid, ··· 2146 2146 static int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port, 2147 2147 const struct switchdev_obj_port_fdb *fdb) 2148 2148 { 2149 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 2149 + struct mv88e6xxx_chip *chip = ds->priv; 2150 2150 int err; 2151 2151 2152 2152 mutex_lock(&chip->reg_lock); ··· 2306 2306 struct switchdev_obj_port_fdb *fdb, 2307 2307 int (*cb)(struct switchdev_obj *obj)) 2308 2308 { 2309 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 2309 + struct mv88e6xxx_chip *chip = ds->priv; 2310 2310 int err; 2311 2311 2312 2312 mutex_lock(&chip->reg_lock); ··· 2319 2319 static int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, 2320 2320 struct net_device *bridge) 2321 2321 { 2322 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 2322 + struct mv88e6xxx_chip *chip = ds->priv; 2323 2323 int i, err = 0; 2324 2324 2325 2325 mutex_lock(&chip->reg_lock); ··· 2342 2342 2343 2343 static void mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port) 2344 2344 { 2345 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 2345 + struct mv88e6xxx_chip *chip = ds->priv; 2346 2346 struct net_device *bridge = chip->ports[port].bridge_dev; 2347 2347 int i; 2348 2348 ··· 2763 2763 static int mv88e6xxx_set_ageing_time(struct dsa_switch *ds, 2764 2764 unsigned int ageing_time) 2765 2765 { 2766 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 2766 + struct mv88e6xxx_chip *chip = ds->priv; 2767 2767 int err; 2768 2768 2769 2769 mutex_lock(&chip->reg_lock); ··· 3204 3204 3205 3205 static int mv88e6xxx_setup(struct dsa_switch *ds) 3206 3206 { 3207 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3207 + struct mv88e6xxx_chip *chip = ds->priv; 3208 3208 int err; 3209 3209 int i; 3210 3210 ··· 3244 3244 3245 3245 static int mv88e6xxx_set_addr(struct dsa_switch *ds, u8 *addr) 3246 3246 { 3247 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3247 + struct mv88e6xxx_chip *chip = ds->priv; 3248 3248 int err; 3249 3249 3250 3250 mutex_lock(&chip->reg_lock); ··· 3352 3352 3353 3353 static int mv88e61xx_get_temp(struct dsa_switch *ds, int *temp) 3354 3354 { 3355 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3355 + struct mv88e6xxx_chip *chip = ds->priv; 3356 3356 u16 val; 3357 3357 int ret; 3358 3358 ··· 3395 3395 3396 3396 static int mv88e63xx_get_temp(struct dsa_switch *ds, int *temp) 3397 3397 { 3398 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3398 + struct mv88e6xxx_chip *chip = ds->priv; 3399 3399 int phy = mv88e6xxx_6320_family(chip) ? 3 : 0; 3400 3400 u16 val; 3401 3401 int ret; ··· 3415 3415 3416 3416 static int mv88e6xxx_get_temp(struct dsa_switch *ds, int *temp) 3417 3417 { 3418 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3418 + struct mv88e6xxx_chip *chip = ds->priv; 3419 3419 3420 3420 if (!mv88e6xxx_has(chip, MV88E6XXX_FLAG_TEMP)) 3421 3421 return -EOPNOTSUPP; ··· 3428 3428 3429 3429 static int mv88e6xxx_get_temp_limit(struct dsa_switch *ds, int *temp) 3430 3430 { 3431 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3431 + struct mv88e6xxx_chip *chip = ds->priv; 3432 3432 int phy = mv88e6xxx_6320_family(chip) ? 3 : 0; 3433 3433 u16 val; 3434 3434 int ret; ··· 3451 3451 3452 3452 static int mv88e6xxx_set_temp_limit(struct dsa_switch *ds, int temp) 3453 3453 { 3454 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3454 + struct mv88e6xxx_chip *chip = ds->priv; 3455 3455 int phy = mv88e6xxx_6320_family(chip) ? 3 : 0; 3456 3456 u16 val; 3457 3457 int err; ··· 3474 3474 3475 3475 static int mv88e6xxx_get_temp_alarm(struct dsa_switch *ds, bool *alarm) 3476 3476 { 3477 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3477 + struct mv88e6xxx_chip *chip = ds->priv; 3478 3478 int phy = mv88e6xxx_6320_family(chip) ? 3 : 0; 3479 3479 u16 val; 3480 3480 int ret; ··· 3498 3498 3499 3499 static int mv88e6xxx_get_eeprom_len(struct dsa_switch *ds) 3500 3500 { 3501 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3501 + struct mv88e6xxx_chip *chip = ds->priv; 3502 3502 3503 3503 return chip->eeprom_len; 3504 3504 } ··· 3556 3556 static int mv88e6xxx_get_eeprom(struct dsa_switch *ds, 3557 3557 struct ethtool_eeprom *eeprom, u8 *data) 3558 3558 { 3559 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3559 + struct mv88e6xxx_chip *chip = ds->priv; 3560 3560 int err; 3561 3561 3562 3562 mutex_lock(&chip->reg_lock); ··· 3645 3645 static int mv88e6xxx_set_eeprom(struct dsa_switch *ds, 3646 3646 struct ethtool_eeprom *eeprom, u8 *data) 3647 3647 { 3648 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3648 + struct mv88e6xxx_chip *chip = ds->priv; 3649 3649 int err; 3650 3650 3651 3651 if (eeprom->magic != 0xc3ec4951) ··· 3953 3953 3954 3954 static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds) 3955 3955 { 3956 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 3956 + struct mv88e6xxx_chip *chip = ds->priv; 3957 3957 3958 3958 if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_EDSA)) 3959 3959 return DSA_TAG_PROTO_EDSA; ··· 4018 4018 const struct switchdev_obj_port_mdb *mdb, 4019 4019 struct switchdev_trans *trans) 4020 4020 { 4021 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 4021 + struct mv88e6xxx_chip *chip = ds->priv; 4022 4022 4023 4023 mutex_lock(&chip->reg_lock); 4024 4024 if (mv88e6xxx_port_db_load_purge(chip, port, mdb->addr, mdb->vid, ··· 4030 4030 static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port, 4031 4031 const struct switchdev_obj_port_mdb *mdb) 4032 4032 { 4033 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 4033 + struct mv88e6xxx_chip *chip = ds->priv; 4034 4034 int err; 4035 4035 4036 4036 mutex_lock(&chip->reg_lock); ··· 4045 4045 struct switchdev_obj_port_mdb *mdb, 4046 4046 int (*cb)(struct switchdev_obj *obj)) 4047 4047 { 4048 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 4048 + struct mv88e6xxx_chip *chip = ds->priv; 4049 4049 int err; 4050 4050 4051 4051 mutex_lock(&chip->reg_lock); ··· 4173 4173 static void mv88e6xxx_remove(struct mdio_device *mdiodev) 4174 4174 { 4175 4175 struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); 4176 - struct mv88e6xxx_chip *chip = ds_to_priv(ds); 4176 + struct mv88e6xxx_chip *chip = ds->priv; 4177 4177 4178 4178 mv88e6xxx_phy_destroy(chip); 4179 4179 mv88e6xxx_unregister_switch(chip);
-5
include/net/dsa.h
··· 391 391 void unregister_switch_driver(struct dsa_switch_ops *type); 392 392 struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev); 393 393 394 - static inline void *ds_to_priv(struct dsa_switch *ds) 395 - { 396 - return ds->priv; 397 - } 398 - 399 394 static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst) 400 395 { 401 396 return dst->rcv != NULL;