net: dsa: only check presence of link property
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Fri, 3 Nov 2017 23:05:28 +0000 (19:05 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 5 Nov 2017 13:31:39 +0000 (22:31 +0900)
When parsing a port, simply use of_property_read_bool which checks the
presence of a given property, instead of parsing the link phandle.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa2.c

index dfcb6247f2f2ccaded053cc48cea687e601b208c..06bcdb6bc796b548ff4b3c02afb83a7e4ec3374b 100644 (file)
@@ -590,8 +590,8 @@ static int dsa_dst_parse(struct dsa_switch_tree *dst)
 static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn)
 {
        struct device_node *ethernet = of_parse_phandle(dn, "ethernet", 0);
-       struct device_node *link = of_parse_phandle(dn, "link", 0);
        const char *name = of_get_property(dn, "label", NULL);
+       bool link = of_property_read_bool(dn, "link");
 
        if (ethernet) {
                struct net_device *master;