Commit 57a57499 authored by Roel Kluin's avatar Roel Kluin Committed by David S. Miller

phylib: unsigneds go unnoticed

both pdata->mdc and pdata->mdio are unsigned. Notice a negative
return value.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9f4d26d0
...@@ -200,16 +200,21 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev, ...@@ -200,16 +200,21 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
{ {
struct device_node *np = NULL; struct device_node *np = NULL;
struct mdio_gpio_platform_data *pdata; struct mdio_gpio_platform_data *pdata;
int ret;
pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
if (!pdata) if (!pdata)
return -ENOMEM; return -ENOMEM;
pdata->mdc = of_get_gpio(ofdev->node, 0); ret = of_get_gpio(ofdev->node, 0);
pdata->mdio = of_get_gpio(ofdev->node, 1); if (ret < 0)
if (pdata->mdc < 0 || pdata->mdio < 0)
goto out_free; goto out_free;
pdata->mdc = ret;
ret = of_get_gpio(ofdev->node, 1);
if (ret < 0)
goto out_free;
pdata->mdio = ret;
while ((np = of_get_next_child(ofdev->node, np))) while ((np = of_get_next_child(ofdev->node, np)))
if (!strcmp(np->type, "ethernet-phy")) if (!strcmp(np->type, "ethernet-phy"))
......
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