diff options
-rw-r--r-- | drivers/pcmcia/pxa2xx_base.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index 3c01774eb39..3755e7c8c71 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -285,8 +285,16 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
285 | struct clk *clk; | 285 | struct clk *clk; |
286 | 286 | ||
287 | ops = (struct pcmcia_low_level *)dev->dev.platform_data; | 287 | ops = (struct pcmcia_low_level *)dev->dev.platform_data; |
288 | if (!ops) | 288 | if (!ops) { |
289 | return -ENODEV; | 289 | ret = -ENODEV; |
290 | goto err0; | ||
291 | } | ||
292 | |||
293 | if (cpu_is_pxa320() && ops->nr > 1) { | ||
294 | dev_err(&dev->dev, "pxa320 supports only one pcmcia slot"); | ||
295 | ret = -EINVAL; | ||
296 | goto err0; | ||
297 | } | ||
290 | 298 | ||
291 | clk = clk_get(&dev->dev, NULL); | 299 | clk = clk_get(&dev->dev, NULL); |
292 | if (!clk) | 300 | if (!clk) |
@@ -316,7 +324,7 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
316 | 324 | ||
317 | ret = pxa2xx_drv_pcmcia_add_one(skt); | 325 | ret = pxa2xx_drv_pcmcia_add_one(skt); |
318 | if (ret) | 326 | if (ret) |
319 | break; | 327 | goto err1; |
320 | } | 328 | } |
321 | 329 | ||
322 | if (ret) { | 330 | if (ret) { |
@@ -329,6 +337,13 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
329 | dev_set_drvdata(&dev->dev, sinfo); | 337 | dev_set_drvdata(&dev->dev, sinfo); |
330 | } | 338 | } |
331 | 339 | ||
340 | return 0; | ||
341 | |||
342 | err1: | ||
343 | while (--i >= 0) | ||
344 | soc_pcmcia_remove_one(&sinfo->skt[i]); | ||
345 | kfree(sinfo); | ||
346 | err0: | ||
332 | return ret; | 347 | return ret; |
333 | } | 348 | } |
334 | 349 | ||