Browse Source

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>
Philipp Zabel 16 years ago
parent
commit
d6c9b5ed37
1 changed files with 5 additions and 7 deletions
  1. 5 7
      drivers/mmc/host/tmio_mmc.c

+ 5 - 7
drivers/mmc/host/tmio_mmc.c

@@ -522,23 +522,21 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
 	struct resource *res_ctl, *res_cnf;
 	struct resource *res_ctl, *res_cnf;
 	struct tmio_mmc_host *host;
 	struct tmio_mmc_host *host;
 	struct mmc_host *mmc;
 	struct mmc_host *mmc;
-	int ret = -ENOMEM;
+	int ret = -EINVAL;
 
 
 	if (dev->num_resources != 3)
 	if (dev->num_resources != 3)
 		goto out;
 		goto out;
 
 
 	res_ctl = platform_get_resource(dev, IORESOURCE_MEM, 0);
 	res_ctl = platform_get_resource(dev, IORESOURCE_MEM, 0);
 	res_cnf = platform_get_resource(dev, IORESOURCE_MEM, 1);
 	res_cnf = platform_get_resource(dev, IORESOURCE_MEM, 1);
-	if (!res_ctl || !res_cnf) {
-		ret = -EINVAL;
+	if (!res_ctl || !res_cnf)
 		goto out;
 		goto out;
-	}
 
 
 	pdata = cell->driver_data;
 	pdata = cell->driver_data;
-	if (!pdata || !pdata->hclk) {
-		ret = -EINVAL;
+	if (!pdata || !pdata->hclk)
 		goto out;
 		goto out;
-	}
+
+	ret = -ENOMEM;
 
 
 	mmc = mmc_alloc_host(sizeof(struct tmio_mmc_host), &dev->dev);
 	mmc = mmc_alloc_host(sizeof(struct tmio_mmc_host), &dev->dev);
 	if (!mmc)
 	if (!mmc)