diff options
author | Johan Hovold <jhovold@gmail.com> | 2014-05-08 04:09:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-09 15:51:19 -0400 |
commit | 7f52da56f76f61112a9c1db41975376764828e71 (patch) | |
tree | 3f0db059a1b10d8c154b81ab56bde52ae30aa61c /drivers/net/phy/mdio-gpio.c | |
parent | 0953f78971040fff09064bb564d9ac0cd1fb4e69 (diff) |
net: mdio-gpio: warn about missing bus alias id
Use a sane default bus id (rather than -ENODEV) and print a warning when
the bus alias id is missing.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mdio-gpio.c')
-rw-r--r-- | drivers/net/phy/mdio-gpio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c index 9c4defdec67b..5f1a2250018f 100644 --- a/drivers/net/phy/mdio-gpio.c +++ b/drivers/net/phy/mdio-gpio.c | |||
@@ -215,6 +215,10 @@ static int mdio_gpio_probe(struct platform_device *pdev) | |||
215 | if (pdev->dev.of_node) { | 215 | if (pdev->dev.of_node) { |
216 | pdata = mdio_gpio_of_get_data(pdev); | 216 | pdata = mdio_gpio_of_get_data(pdev); |
217 | bus_id = of_alias_get_id(pdev->dev.of_node, "mdio-gpio"); | 217 | bus_id = of_alias_get_id(pdev->dev.of_node, "mdio-gpio"); |
218 | if (bus_id < 0) { | ||
219 | dev_warn(&pdev->dev, "failed to get alias id\n"); | ||
220 | bus_id = 0; | ||
221 | } | ||
218 | } else { | 222 | } else { |
219 | pdata = dev_get_platdata(&pdev->dev); | 223 | pdata = dev_get_platdata(&pdev->dev); |
220 | bus_id = pdev->id; | 224 | bus_id = pdev->id; |