net: dsa: mv88e6xxx: skip unused ports
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Thu, 26 Oct 2017 15:22:52 +0000 (11:22 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Oct 2017 15:00:09 +0000 (00:00 +0900)
The unused ports are currently configured in normal mode. This does not
prevent the switch from being functional, but it is unnecessary. Skip
unused ports.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c

index 677d6902807ec145aaebf30d7e6752d80f380ded..2d8cf66e8f74226bbdd98b2d5dc7085d60c5e134 100644 (file)
@@ -2005,6 +2005,9 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
 
        /* Setup Switch Port Registers */
        for (i = 0; i < mv88e6xxx_num_ports(chip); i++) {
+               if (dsa_is_unused_port(ds, i))
+                       continue;
+
                err = mv88e6xxx_setup_port(chip, i);
                if (err)
                        goto unlock;