aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-01-19 20:14:21 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-21 17:34:53 -0500
commit57a574993d94671b495cdbe8aeb78b745abfe14f (patch)
tree9dbc0c87354661573418d833bb431cf367bb5caa /drivers/net/phy
parent9f4d26d0f3016cf8813977d624751b94465fa317 (diff)
phylib: unsigneds go unnoticed
both pdata->mdc and pdata->mdio are unsigned. Notice a negative return value. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/mdio-gpio.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index a439ebeb4319..3f460c564927 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -200,16 +200,21 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
200{ 200{
201 struct device_node *np = NULL; 201 struct device_node *np = NULL;
202 struct mdio_gpio_platform_data *pdata; 202 struct mdio_gpio_platform_data *pdata;
203 int ret;
203 204
204 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); 205 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
205 if (!pdata) 206 if (!pdata)
206 return -ENOMEM; 207 return -ENOMEM;
207 208
208 pdata->mdc = of_get_gpio(ofdev->node, 0); 209 ret = of_get_gpio(ofdev->node, 0);
209 pdata->mdio = of_get_gpio(ofdev->node, 1); 210 if (ret < 0)
210
211 if (pdata->mdc < 0 || pdata->mdio < 0)
212 goto out_free; 211 goto out_free;
212 pdata->mdc = ret;
213
214 ret = of_get_gpio(ofdev->node, 1);
215 if (ret < 0)
216 goto out_free;
217 pdata->mdio = ret;
213 218
214 while ((np = of_get_next_child(ofdev->node, np))) 219 while ((np = of_get_next_child(ofdev->node, np)))
215 if (!strcmp(np->type, "ethernet-phy")) 220 if (!strcmp(np->type, "ethernet-phy"))