diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2015-03-05 15:35:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-06 00:18:20 -0500 |
commit | b324c07ac4771a6ac8f57a3e1897e1b36b0a9ff0 (patch) | |
tree | 06bca8330ded3688b456c19a3f0a52b86e714188 /net/dsa | |
parent | f1a26a062f03b27fa52f62487897fe205303fa7f (diff) |
net: dsa: allow deferred probing
In preparation for allowing a different model to register DSA switches,
update dsa_of_probe() and dsa_probe() to return -EPROBE_DEFER where
appropriate.
Failure to find a phandle or Device Tree property is still fatal, but
looking up the internal device structure associated with a Device Tree
node is something that might need to be delayed based on driver probe
ordering.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/dsa.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index d804364150bd..79879d01488a 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
@@ -583,7 +583,7 @@ static int dsa_of_probe(struct device *dev) | |||
583 | 583 | ||
584 | mdio_bus = of_mdio_find_bus(mdio); | 584 | mdio_bus = of_mdio_find_bus(mdio); |
585 | if (!mdio_bus) | 585 | if (!mdio_bus) |
586 | return -EINVAL; | 586 | return -EPROBE_DEFER; |
587 | 587 | ||
588 | ethernet = of_parse_phandle(np, "dsa,ethernet", 0); | 588 | ethernet = of_parse_phandle(np, "dsa,ethernet", 0); |
589 | if (!ethernet) | 589 | if (!ethernet) |
@@ -591,7 +591,7 @@ static int dsa_of_probe(struct device *dev) | |||
591 | 591 | ||
592 | ethernet_dev = of_find_device_by_node(ethernet); | 592 | ethernet_dev = of_find_device_by_node(ethernet); |
593 | if (!ethernet_dev) | 593 | if (!ethernet_dev) |
594 | return -ENODEV; | 594 | return -EPROBE_DEFER; |
595 | 595 | ||
596 | pd = kzalloc(sizeof(*pd), GFP_KERNEL); | 596 | pd = kzalloc(sizeof(*pd), GFP_KERNEL); |
597 | if (!pd) | 597 | if (!pd) |
@@ -718,7 +718,7 @@ static int dsa_probe(struct platform_device *pdev) | |||
718 | 718 | ||
719 | dev = dev_to_net_device(pd->netdev); | 719 | dev = dev_to_net_device(pd->netdev); |
720 | if (dev == NULL) { | 720 | if (dev == NULL) { |
721 | ret = -EINVAL; | 721 | ret = -EPROBE_DEFER; |
722 | goto out; | 722 | goto out; |
723 | } | 723 | } |
724 | 724 | ||