]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: Initialize all CPU and enabled ports masks in dsa_ds_parse()
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 2 Jun 2017 19:31:23 +0000 (12:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Jun 2017 00:05:15 +0000 (20:05 -0400)
commit92836d88e6facd3d89cc96d740585b0d3334ab06
tree588f98e84727f296a0383a1e359359017e6704d2
parent54b8eb556f215cf34253fb28b3d5174bec2b5435
net: dsa: Initialize all CPU and enabled ports masks in dsa_ds_parse()

There was no reason for duplicating the code that initializes
ds->enabled_port_mask in both dsa_parse_ports_dn() and
dsa_parse_ports(), instead move this to dsa_ds_parse() which is early
enough before ops->setup() has run.

While at it, we can now make dsa_is_cpu_port() check ds->cpu_port_mask
which is a step towards being multi-CPU port capable.

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