Commit 7f52da56 authored by Johan Hovold's avatar Johan Hovold Committed by David S. Miller

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: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0953f789
...@@ -215,6 +215,10 @@ static int mdio_gpio_probe(struct platform_device *pdev) ...@@ -215,6 +215,10 @@ static int mdio_gpio_probe(struct platform_device *pdev)
if (pdev->dev.of_node) { if (pdev->dev.of_node) {
pdata = mdio_gpio_of_get_data(pdev); pdata = mdio_gpio_of_get_data(pdev);
bus_id = of_alias_get_id(pdev->dev.of_node, "mdio-gpio"); 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 { } else {
pdata = dev_get_platdata(&pdev->dev); pdata = dev_get_platdata(&pdev->dev);
bus_id = pdev->id; bus_id = pdev->id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment