aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2009-06-04 14:12:34 -0400
committerPierre Ossman <pierre@ossman.eu>2009-06-13 16:43:00 -0400
commitd6c9b5ed37c26503795d241474a17db1d306e7ea (patch)
treef85538919e7f2acaa3bf187249fd5542c2f95d3b /drivers
parent6c413cc76b893310b3b258b7de47fb74dcc50203 (diff)
tmio_mmc: correct probe return value for num_resources != 3
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Acked-by: Ian Molton <ian@mnementh.co.uk> Signed-off-by: Pierre Ossman <pierre@ossman.eu>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/tmio_mmc.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index bbcbd72a46a4..b57664070485 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -522,23 +522,21 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
522 struct resource *res_ctl, *res_cnf; 522 struct resource *res_ctl, *res_cnf;
523 struct tmio_mmc_host *host; 523 struct tmio_mmc_host *host;
524 struct mmc_host *mmc; 524 struct mmc_host *mmc;
525 int ret = -ENOMEM; 525 int ret = -EINVAL;
526 526
527 if (dev->num_resources != 3) 527 if (dev->num_resources != 3)
528 goto out; 528 goto out;
529 529
530 res_ctl = platform_get_resource(dev, IORESOURCE_MEM, 0); 530 res_ctl = platform_get_resource(dev, IORESOURCE_MEM, 0);
531 res_cnf = platform_get_resource(dev, IORESOURCE_MEM, 1); 531 res_cnf = platform_get_resource(dev, IORESOURCE_MEM, 1);
532 if (!res_ctl || !res_cnf) { 532 if (!res_ctl || !res_cnf)
533 ret = -EINVAL;
534 goto out; 533 goto out;
535 }
536 534
537 pdata = cell->driver_data; 535 pdata = cell->driver_data;
538 if (!pdata || !pdata->hclk) { 536 if (!pdata || !pdata->hclk)
539 ret = -EINVAL;
540 goto out; 537 goto out;
541 } 538
539 ret = -ENOMEM;
542 540
543 mmc = mmc_alloc_host(sizeof(struct tmio_mmc_host), &dev->dev); 541 mmc = mmc_alloc_host(sizeof(struct tmio_mmc_host), &dev->dev);
544 if (!mmc) 542 if (!mmc)