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 <stummala@codeaurora.org>
This commit is contained in:
Sahitya Tummala 2013-05-24 08:47:26 +05:30 committed by Subhash Jadavani
parent a45d072d68
commit f9359ba80e

View file

@ -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.