msm: qcn: Synchronize card state change API

Update card state change API to synchronize multiple invocation
of the same API from different drivers.

Change-Id: I03c18a9540bdb64fa462262faa9cabe158e9e199
Signed-off-by: Amandeep Singh <amansing@codeaurora.org>
This commit is contained in:
Amandeep Singh 2019-08-27 13:12:12 +05:30
parent 9ea2de0a4e
commit 652a8550db

View file

@ -1221,11 +1221,14 @@ int qcn_sdio_card_state(bool enable)
mmc_try_claim_host(current_host, 2000);
if (enable) {
ret = mmc_add_host(current_host);
if (ret)
pr_err("%s ret = %d\n", __func__, ret);
if (!atomic_read(&xport_status)) {
ret = mmc_add_host(current_host);
if (ret)
pr_err("%s ret = %d\n", __func__, ret);
}
} else {
mmc_remove_host(current_host);
if (atomic_read(&xport_status))
mmc_remove_host(current_host);
}
mmc_release_host(current_host);