[PATCH 5/5] mmc: msm_sdcc: Remove unwanted initializations in probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This removes unnecessary initialisations of resource pointers
and does away with a lable and just returns error on fail instead.

Cc: David Brown <davidb@xxxxxxxxxxxxxx>
Cc: Daniel Walker <dwalker@xxxxxxxxxx>
Cc: Bryan Huntsman <bryanh@xxxxxxxxxxxxxx>
CC: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
CC: linux-mmc@xxxxxxxxxxxxxxx
CC: linux-arm-msm@xxxxxxxxxxxxxxx
Signed-off-by: Pramod Gurav <pramod.gurav@xxxxxxxxxxxxxxx>
---
 drivers/mmc/host/msm_sdcc.c |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 5025364..2b0c4d9 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1166,17 +1166,16 @@ msmsdcc_probe(struct platform_device *pdev)
 	struct msm_mmc_platform_data *plat = pdev->dev.platform_data;
 	struct msmsdcc_host *host;
 	struct mmc_host *mmc;
-	struct resource *cmd_irqres = NULL;
-	struct resource *stat_irqres = NULL;
-	struct resource *memres = NULL;
-	struct resource *dmares = NULL;
+	struct resource *cmd_irqres;
+	struct resource *stat_irqres;
+	struct resource *memres;
+	struct resource *dmares;
 	int ret;
 
 	/* must have platform data */
 	if (!plat) {
 		dev_err(&pdev->dev, "Platform data not available\n");
-		ret = -EINVAL;
-		goto out;
+		return -EINVAL;
 	}
 
 	if (pdev->id < 1 || pdev->id > 4)
@@ -1201,12 +1200,9 @@ msmsdcc_probe(struct platform_device *pdev)
 	/*
 	 * Setup our host structure
 	 */
-
 	mmc = mmc_alloc_host(sizeof(struct msmsdcc_host), &pdev->dev);
-	if (!mmc) {
-		ret = -ENOMEM;
-		goto out;
-	}
+	if (!mmc)
+		return -ENOMEM;
 
 	host = mmc_priv(mmc);
 	host->pdev_id = pdev->id;
@@ -1402,7 +1398,7 @@ msmsdcc_probe(struct platform_device *pdev)
 	tasklet_kill(&host->dma_tlet);
  host_free:
 	mmc_free_host(mmc);
- out:
+
 	return ret;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux