• Baruch Siach's avatar
    net: mvpp2: initialize port of_node pointer · c4053ef3
    Baruch Siach authored
    Without a valid of_node in struct device we can't find the mvpp2 port
    device by its DT node. Specifically, this breaks
    of_find_net_device_by_node().
    
    For example, the Armada 8040 based Clearfog GT-8K uses Marvell 88E6141
    switch connected to the &cp1_eth2 port:
    
    &cp1_mdio {
    	...
    
    	switch0: switch0@4 {
    		compatible = "marvell,mv88e6085";
    		...
    
    		ports {
    			...
    
    			port@5 {
    				reg = <5>;
    				label = "cpu";
    				ethernet = <&cp1_eth2>;
    			};
    		};
    	};
    };
    
    Without this patch, dsa_register_switch() returns -EPROBE_DEFER because
    of_find_net_device_by_node() can't find the device_node of the &cp1_eth2
    device.
    Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
    Signed-off-by: default avatarBaruch Siach <baruch@tkos.co.il>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c4053ef3
mvpp2_main.c 143 KB