net: dsa: mv88e6xxx: unregister mv88e6352 driver
[firefly-linux-kernel-4.4.55.git] / drivers / net / dsa / mv88e6xxx.c
index fc8d3b6ffe8e0b35e64ed2aaa78b342a1b86f66a..cf309aa92802623ec0532b56b1dd10a88a234af1 100644 (file)
@@ -602,8 +602,6 @@ static void _mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds,
                u32 high = 0;
 
                if (s->reg >= 0x100) {
-                       int ret;
-
                        ret = mv88e6xxx_reg_read(ds, REG_PORT(port),
                                                 s->reg - 0x100);
                        if (ret < 0)
@@ -902,14 +900,16 @@ static int _mv88e6xxx_flush_fid(struct dsa_switch *ds, int fid)
 static int mv88e6xxx_set_port_state(struct dsa_switch *ds, int port, u8 state)
 {
        struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
-       int reg, ret;
+       int reg, ret = 0;
        u8 oldstate;
 
        mutex_lock(&ps->smi_mutex);
 
        reg = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_CONTROL);
-       if (reg < 0)
+       if (reg < 0) {
+               ret = reg;
                goto abort;
+       }
 
        oldstate = reg & PORT_CONTROL_STATE_MASK;
        if (oldstate != state) {
@@ -1251,8 +1251,7 @@ int mv88e6xxx_setup_port_common(struct dsa_switch *ds, int port)
        /* Port Control 1: disable trunking, disable sending
         * learning messages to this port.
         */
-       ret = _mv88e6xxx_reg_write(ds, REG_PORT(port), PORT_DEFAULT_VLAN,
-                                  0x0000);
+       ret = _mv88e6xxx_reg_write(ds, REG_PORT(port), PORT_CONTROL_1, 0x0000);
        if (ret)
                goto abort;
 
@@ -1275,7 +1274,8 @@ int mv88e6xxx_setup_port_common(struct dsa_switch *ds, int port)
        /* Default VLAN ID and priority: don't set a default VLAN
         * ID, and set the default packet priority to zero.
         */
-       ret = _mv88e6xxx_reg_write(ds, REG_PORT(port), 0x07, 0x0000);
+       ret = _mv88e6xxx_reg_write(ds, REG_PORT(port), PORT_DEFAULT_VLAN,
+                                  0x0000);
 abort:
        mutex_unlock(&ps->smi_mutex);
        return ret;
@@ -1469,6 +1469,9 @@ static void __exit mv88e6xxx_cleanup(void)
 #if IS_ENABLED(CONFIG_NET_DSA_MV88E6171)
        unregister_switch_driver(&mv88e6171_switch_driver);
 #endif
+#if IS_ENABLED(CONFIG_NET_DSA_MV88E6352)
+       unregister_switch_driver(&mv88e6352_switch_driver);
+#endif
 #if IS_ENABLED(CONFIG_NET_DSA_MV88E6123_61_65)
        unregister_switch_driver(&mv88e6123_61_65_switch_driver);
 #endif