dsa: Replace mii_bus with a generic host device
[linux-2.6-block.git] / drivers / net / dsa / mv88e6123_61_65.c
index 69c42513dd724bb06ef40eaf4b5e4bbea800936d..a332c53ff955906eaeec11edd81350b247561fed 100644 (file)
 #include <net/dsa.h>
 #include "mv88e6xxx.h"
 
-static char *mv88e6123_61_65_probe(struct mii_bus *bus, int sw_addr)
+static char *mv88e6123_61_65_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), 0x03);
        if (ret >= 0) {
                if (ret == 0x1212)
@@ -207,7 +211,7 @@ static int mv88e6123_61_65_setup_port(struct dsa_switch *ds, int p)
         */
        val = 0x0433;
        if (dsa_is_cpu_port(ds, p)) {
-               if (ds->dst->tag_protocol == htons(ETH_P_EDSA))
+               if (ds->dst->tag_protocol == DSA_TAG_PROTO_EDSA)
                        val |= 0x3300;
                else
                        val |= 0x0100;
@@ -391,7 +395,7 @@ static int mv88e6123_61_65_get_sset_count(struct dsa_switch *ds)
 }
 
 struct dsa_switch_driver mv88e6123_61_65_switch_driver = {
-       .tag_protocol           = cpu_to_be16(ETH_P_EDSA),
+       .tag_protocol           = DSA_TAG_PROTO_EDSA,
        .priv_size              = sizeof(struct mv88e6xxx_priv_state),
        .probe                  = mv88e6123_61_65_probe,
        .setup                  = mv88e6123_61_65_setup,