Skip to content

Commit

Permalink
net: mdio-gpio: warn about missing bus alias id
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold authored and David S. Miller committed May 9, 2014
1 parent 0953f78 commit 7f52da5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/phy/mdio-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ static int mdio_gpio_probe(struct platform_device *pdev)
if (pdev->dev.of_node) {
pdata = mdio_gpio_of_get_data(pdev);
bus_id = of_alias_get_id(pdev->dev.of_node, "mdio-gpio");
if (bus_id < 0) {
dev_warn(&pdev->dev, "failed to get alias id\n");
bus_id = 0;
}
} else {
pdata = dev_get_platdata(&pdev->dev);
bus_id = pdev->id;
Expand Down

0 comments on commit 7f52da5

Please sign in to comment.