From f9359ba80e55fba4612d2b627c079bcc61e60444 Mon Sep 17 00:00:00 2001 From: Sahitya Tummala Date: Fri, 24 May 2013 08:47:26 +0530 Subject: [PATCH] mmc: sdhci: initialize sdhci_host lock in sdhci_alloc_host() Currently, the sdhci host lock is initialized in sdhci_add_host() but there can be a case where it is required even before that. Hence, initialize it in sdhci_alloc_host() where sdhci_host structure is allocated. Change-Id: If99d82679c07bc2d36e0aad9354757288aa400b8 Signed-off-by: Sahitya Tummala --- drivers/mmc/host/sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 24f3cac7879f..4930d9f09d7f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3181,6 +3181,8 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev, host = mmc_priv(mmc); host->mmc = mmc; + spin_lock_init(&host->lock); + return host; } @@ -3622,8 +3624,6 @@ int sdhci_add_host(struct sdhci_host *host) return -ENODEV; } - spin_lock_init(&host->lock); - /* * Maximum number of segments. Depends on if the hardware * can do scatter/gather or not.