]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/dsa/mv88e6171.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide
[karo-tx-linux.git] / drivers / net / dsa / mv88e6171.c
index 2c8eb6f76ebe02a54f71539d3799f21f879e01f8..54aa00012dd0ce5ca36427c0cfb41f773ea47138 100644 (file)
 #include <net/dsa.h>
 #include "mv88e6xxx.h"
 
+static const struct mv88e6xxx_switch_id mv88e6171_table[] = {
+       { PORT_SWITCH_ID_6171, "Marvell 88E6171" },
+       { PORT_SWITCH_ID_6175, "Marvell 88E6175" },
+       { PORT_SWITCH_ID_6350, "Marvell 88E6350" },
+       { PORT_SWITCH_ID_6351, "Marvell 88E6351" },
+};
+
 static char *mv88e6171_probe(struct device *host_dev, int sw_addr)
 {
-       struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
-       int ret;
-
-       if (bus == NULL)
-               return NULL;
-
-       ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), PORT_SWITCH_ID);
-       if (ret >= 0) {
-               if ((ret & 0xfff0) == PORT_SWITCH_ID_6171)
-                       return "Marvell 88E6171";
-               if ((ret & 0xfff0) == PORT_SWITCH_ID_6175)
-                       return "Marvell 88E6175";
-               if ((ret & 0xfff0) == PORT_SWITCH_ID_6350)
-                       return "Marvell 88E6350";
-               if ((ret & 0xfff0) == PORT_SWITCH_ID_6351)
-                       return "Marvell 88E6351";
-       }
-
-       return NULL;
+       return mv88e6xxx_lookup_name(host_dev, sw_addr, mv88e6171_table,
+                                    ARRAY_SIZE(mv88e6171_table));
 }
 
 static int mv88e6171_setup_global(struct dsa_switch *ds)
@@ -115,7 +105,7 @@ struct dsa_switch_driver mv88e6171_switch_driver = {
        .get_regs               = mv88e6xxx_get_regs,
        .port_stp_update        = mv88e6xxx_port_stp_update,
        .port_pvid_get          = mv88e6xxx_port_pvid_get,
-       .port_pvid_set          = mv88e6xxx_port_pvid_set,
+       .port_vlan_prepare      = mv88e6xxx_port_vlan_prepare,
        .port_vlan_add          = mv88e6xxx_port_vlan_add,
        .port_vlan_del          = mv88e6xxx_port_vlan_del,
        .vlan_getnext           = mv88e6xxx_vlan_getnext,