]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: make "label" property optional for dsa2
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Mon, 9 Jan 2017 23:13:51 +0000 (18:13 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Jan 2017 14:26:15 +0000 (09:26 -0500)
commit29dfb8c729ac8182243ca0ed94b0363d825e97d7
tree6152c556f7c54562d5da85422e83277f6c1f7d03
parentccce7f583f5b6dcf7e3f631c5b4137fab696786f
net: dsa: make "label" property optional for dsa2

In the new DTS bindings for DSA (dsa2), the "ethernet" and "link"
phandles are respectively mandatory and exclusive to CPU port and DSA
link device tree nodes.

Simplify dsa2.c a bit by checking the presence of such phandle instead
of checking the redundant "label" property.

Then the Linux philosophy for Ethernet switch ports is to expose them to
userspace as standard NICs by default. Thus use the standard enumerated
"eth%d" device name if no "label" property is provided for a user port.
This allows to save DTS files from subjective net device names.

If one wants to rename an interface, udev rules can be used as usual.

Of course the current behavior is unchanged, and the optional "label"
property for user ports has precedence over the enumerated name.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/devicetree/bindings/net/dsa/dsa.txt
net/dsa/dsa2.c