]> git.karo-electronics.de Git - karo-tx-linux.git/commit
net: dsa: Add support for platform data
authorFlorian Fainelli <f.fainelli@gmail.com>
Sat, 4 Feb 2017 21:02:43 +0000 (13:02 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Feb 2017 15:51:45 +0000 (10:51 -0500)
commit71e0bbde0d88047f66b25721f69a441d46083748
treee9ecf5d8c0662c3958ca74fa815a142e9cfdf739
parent14b89f36eed2993670906a3991bca496a5ebf1a6
net: dsa: Add support for platform data

Allow drivers to use the new DSA API with platform data. Most of the
code in net/dsa/dsa2.c does not rely so much on device_nodes and can get
the same information from platform_data instead.

We purposely do not support distributed configurations with platform
data, so drivers should be providing a pointer to a 'struct
dsa_chip_data' structure if they wish to communicate per-port layout.

Multiple CPUs port could potentially be supported and dsa_chip_data is
extended to receive up to one reference to an upstream network device
per port described by a dsa_chip_data structure.

dsa_dev_to_net_device() increments the network device's reference count,
so we intentionally call dev_put() to be consistent with the DT-enabled
path, until we have a generic notifier based solution.

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