]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: mdio-gpio: warn about missing bus alias id
authorJohan Hovold <jhovold@gmail.com>
Thu, 8 May 2014 08:09:21 +0000 (10:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 May 2014 19:51:19 +0000 (15:51 -0400)
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>
drivers/net/phy/mdio-gpio.c

index 9c4defdec67b09299f38f1b06bf8eacbccd007d1..5f1a2250018fec5ba01a2a1a1a11f2d736f544a9 100644 (file)
@@ -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;