net: dsa: mv88e6xxx: allocate the number of ports
The current code allocates DSA_MAX_PORTS ports for a Marvell dsa_switch structure. Provide the exact number of ports so the corresponding ds->num_ports is accurate. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
17a1594e2d
commit
73b1204d07
@ -4286,7 +4286,7 @@ static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
|
|||||||
struct device *dev = chip->dev;
|
struct device *dev = chip->dev;
|
||||||
struct dsa_switch *ds;
|
struct dsa_switch *ds;
|
||||||
|
|
||||||
ds = dsa_switch_alloc(dev, DSA_MAX_PORTS);
|
ds = dsa_switch_alloc(dev, mv88e6xxx_num_ports(chip));
|
||||||
if (!ds)
|
if (!ds)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user