diff options
author | Egil Hjelmeland <privat@egil-hjelmeland.no> | 2017-08-08 00:22:21 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-09 03:13:59 +0200 |
commit | 274cdb46e98b965449c68d912bcc45899ba34593 (patch) | |
tree | 2786c635b97f7bf44df02ea3ed7d5f720f0d6696 /drivers/net/dsa/lan9303-core.c | |
parent | selftests: bpf: add a test for XDP redirect (diff) | |
download | linux-274cdb46e98b965449c68d912bcc45899ba34593.tar.xz linux-274cdb46e98b965449c68d912bcc45899ba34593.zip |
net: dsa: lan9303: Only allocate 3 ports
Save 2628 bytes on arm eabi by allocate only the required 3 ports.
Now that ds->num_ports is correct: In net/dsa/tag_lan9303.c
eliminate duplicate LAN9303_MAX_PORTS, use ds->num_ports.
(Matching the pattern of other net/dsa/tag_xxx.c files.)
Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/lan9303-core.c')
-rw-r--r-- | drivers/net/dsa/lan9303-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index 15befd155251..46fc1d5d3c9e 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -811,7 +811,7 @@ static struct dsa_switch_ops lan9303_switch_ops = { static int lan9303_register_switch(struct lan9303 *chip) { - chip->ds = dsa_switch_alloc(chip->dev, DSA_MAX_PORTS); + chip->ds = dsa_switch_alloc(chip->dev, LAN9303_NUM_PORTS); if (!chip->ds) return -ENOMEM; |