Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f5e9be6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: sd: set card removed to true"

parents 546fc069 85b2cc01
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -3431,8 +3431,14 @@ int mmc_resume_bus(struct mmc_host *host)
	spin_unlock_irqrestore(&host->lock, flags);

	mmc_bus_get(host);
	if (host->ops->get_cd)
	if (host->ops->get_cd) {
		card_present = host->ops->get_cd(host);
		if (!card_present) {
			pr_err("%s: Card removed - card_present:%d\n",
			       mmc_hostname(host), card_present);
			mmc_card_set_removed(host->card);
		}
	}

	if (host->bus_ops && !host->bus_dead && host->card && card_present) {
		mmc_power_up(host, host->card->ocr);
+14 −4
Original line number Diff line number Diff line
@@ -1376,11 +1376,21 @@ static int mmc_sd_resume(struct mmc_host *host)

	MMC_TRACE(host, "%s: Enter\n", __func__);
	err = _mmc_sd_resume(host);
	if (err) {
		pr_err("%s: sd resume err: %d\n", mmc_hostname(host), err);
		if (host->ops->get_cd && !host->ops->get_cd(host)) {
			err = -ENOMEDIUM;
			mmc_card_set_removed(host->card);
		}
	}

	if (err != -ENOMEDIUM) {
		pm_runtime_set_active(&host->card->dev);
		pm_runtime_mark_last_busy(&host->card->dev);
		pm_runtime_enable(&host->card->dev);
	MMC_TRACE(host, "%s: Exit err: %d\n", __func__, err);
	}

	MMC_TRACE(host, "%s: Exit err: %d\n", __func__, err);
	return err;
}