diff mbox series

[net-next,2/9] net: dsa: mv88e6xxx: skip unused ports

Message ID 20171026152259.3123-3-vivien.didelot@savoirfairelinux.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series net: dsa: define port types | expand

Commit Message

Vivien Didelot Oct. 26, 2017, 3:22 p.m. UTC
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>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Florian Fainelli Oct. 26, 2017, 11:08 p.m. UTC | #1
On 10/26/2017 08:22 AM, Vivien Didelot wrote:
> 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>
diff mbox series

Patch

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 677d6902807e..2d8cf66e8f74 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -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;