diff options
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/bcm_sf2.c | 1 | ||||
-rw-r--r-- | drivers/net/dsa/bcm_sf2_cfp.c | 4 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/chip.c | 34 |
3 files changed, 20 insertions, 19 deletions
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index ea01f24f15e7..b62d47210db8 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/netdevice.h> | 14 | #include <linux/netdevice.h> |
15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/of.h> | ||
18 | #include <linux/phy.h> | 17 | #include <linux/phy.h> |
19 | #include <linux/phy_fixed.h> | 18 | #include <linux/phy_fixed.h> |
20 | #include <linux/mii.h> | 19 | #include <linux/mii.h> |
diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c index b721a2009b50..23b45da784cb 100644 --- a/drivers/net/dsa/bcm_sf2_cfp.c +++ b/drivers/net/dsa/bcm_sf2_cfp.c | |||
@@ -625,7 +625,7 @@ static int bcm_sf2_cfp_ipv6_rule_set(struct bcm_sf2_priv *priv, int port, | |||
625 | bcm_sf2_cfp_slice_ipv6(priv, v6_spec->ip6src, v6_spec->psrc, | 625 | bcm_sf2_cfp_slice_ipv6(priv, v6_spec->ip6src, v6_spec->psrc, |
626 | slice_num, false); | 626 | slice_num, false); |
627 | bcm_sf2_cfp_slice_ipv6(priv, v6_m_spec->ip6src, v6_m_spec->psrc, | 627 | bcm_sf2_cfp_slice_ipv6(priv, v6_m_spec->ip6src, v6_m_spec->psrc, |
628 | slice_num, true); | 628 | SLICE_NUM_MASK, true); |
629 | 629 | ||
630 | /* Insert into TCAM now because we need to insert a second rule */ | 630 | /* Insert into TCAM now because we need to insert a second rule */ |
631 | bcm_sf2_cfp_rule_addr_set(priv, rule_index[0]); | 631 | bcm_sf2_cfp_rule_addr_set(priv, rule_index[0]); |
@@ -699,7 +699,7 @@ static int bcm_sf2_cfp_ipv6_rule_set(struct bcm_sf2_priv *priv, int port, | |||
699 | /* Insert into Action and policer RAMs now, set chain ID to | 699 | /* Insert into Action and policer RAMs now, set chain ID to |
700 | * the one we are chained to | 700 | * the one we are chained to |
701 | */ | 701 | */ |
702 | ret = bcm_sf2_cfp_act_pol_set(priv, rule_index[0], port_num, | 702 | ret = bcm_sf2_cfp_act_pol_set(priv, rule_index[1], port_num, |
703 | queue_num, true); | 703 | queue_num, true); |
704 | if (ret) | 704 | if (ret) |
705 | goto out_err; | 705 | goto out_err; |
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 8171055fde7a..66d33e97cbc5 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c | |||
@@ -339,7 +339,7 @@ static void mv88e6xxx_g1_irq_free(struct mv88e6xxx_chip *chip) | |||
339 | u16 mask; | 339 | u16 mask; |
340 | 340 | ||
341 | mv88e6xxx_g1_read(chip, MV88E6XXX_G1_CTL1, &mask); | 341 | mv88e6xxx_g1_read(chip, MV88E6XXX_G1_CTL1, &mask); |
342 | mask |= GENMASK(chip->g1_irq.nirqs, 0); | 342 | mask &= ~GENMASK(chip->g1_irq.nirqs, 0); |
343 | mv88e6xxx_g1_write(chip, MV88E6XXX_G1_CTL1, mask); | 343 | mv88e6xxx_g1_write(chip, MV88E6XXX_G1_CTL1, mask); |
344 | 344 | ||
345 | free_irq(chip->irq, chip); | 345 | free_irq(chip->irq, chip); |
@@ -395,7 +395,7 @@ static int mv88e6xxx_g1_irq_setup(struct mv88e6xxx_chip *chip) | |||
395 | return 0; | 395 | return 0; |
396 | 396 | ||
397 | out_disable: | 397 | out_disable: |
398 | mask |= GENMASK(chip->g1_irq.nirqs, 0); | 398 | mask &= ~GENMASK(chip->g1_irq.nirqs, 0); |
399 | mv88e6xxx_g1_write(chip, MV88E6XXX_G1_CTL1, mask); | 399 | mv88e6xxx_g1_write(chip, MV88E6XXX_G1_CTL1, mask); |
400 | 400 | ||
401 | out_mapping: | 401 | out_mapping: |
@@ -2177,6 +2177,19 @@ static const struct of_device_id mv88e6xxx_mdio_external_match[] = { | |||
2177 | { }, | 2177 | { }, |
2178 | }; | 2178 | }; |
2179 | 2179 | ||
2180 | static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip) | ||
2181 | |||
2182 | { | ||
2183 | struct mv88e6xxx_mdio_bus *mdio_bus; | ||
2184 | struct mii_bus *bus; | ||
2185 | |||
2186 | list_for_each_entry(mdio_bus, &chip->mdios, list) { | ||
2187 | bus = mdio_bus->bus; | ||
2188 | |||
2189 | mdiobus_unregister(bus); | ||
2190 | } | ||
2191 | } | ||
2192 | |||
2180 | static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip, | 2193 | static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip, |
2181 | struct device_node *np) | 2194 | struct device_node *np) |
2182 | { | 2195 | { |
@@ -2201,27 +2214,16 @@ static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip, | |||
2201 | match = of_match_node(mv88e6xxx_mdio_external_match, child); | 2214 | match = of_match_node(mv88e6xxx_mdio_external_match, child); |
2202 | if (match) { | 2215 | if (match) { |
2203 | err = mv88e6xxx_mdio_register(chip, child, true); | 2216 | err = mv88e6xxx_mdio_register(chip, child, true); |
2204 | if (err) | 2217 | if (err) { |
2218 | mv88e6xxx_mdios_unregister(chip); | ||
2205 | return err; | 2219 | return err; |
2220 | } | ||
2206 | } | 2221 | } |
2207 | } | 2222 | } |
2208 | 2223 | ||
2209 | return 0; | 2224 | return 0; |
2210 | } | 2225 | } |
2211 | 2226 | ||
2212 | static void mv88e6xxx_mdios_unregister(struct mv88e6xxx_chip *chip) | ||
2213 | |||
2214 | { | ||
2215 | struct mv88e6xxx_mdio_bus *mdio_bus; | ||
2216 | struct mii_bus *bus; | ||
2217 | |||
2218 | list_for_each_entry(mdio_bus, &chip->mdios, list) { | ||
2219 | bus = mdio_bus->bus; | ||
2220 | |||
2221 | mdiobus_unregister(bus); | ||
2222 | } | ||
2223 | } | ||
2224 | |||
2225 | static int mv88e6xxx_get_eeprom_len(struct dsa_switch *ds) | 2227 | static int mv88e6xxx_get_eeprom_len(struct dsa_switch *ds) |
2226 | { | 2228 | { |
2227 | struct mv88e6xxx_chip *chip = ds->priv; | 2229 | struct mv88e6xxx_chip *chip = ds->priv; |