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

Commit 87123a54 authored by Vijay Viswanath's avatar Vijay Viswanath
Browse files

mmc: core: Avoid returning error when clok scaling devfreq is removed



When resume clock scaling is not possible because there is no devfreq
framework, it is not an error. So avoid printing an error and return
success. This is necessary in certain scenarios like during shutdown
where we unregister the clock scaling devfreq.

Change-Id: Ib37eabdcdbbb58a336ee87220e5758bb559625af
Signed-off-by: default avatarVijay Viswanath <vviswana@codeaurora.org>
parent 1a7276f0
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -794,10 +794,15 @@ int mmc_resume_clk_scaling(struct mmc_host *host)
	if (!mmc_can_scale_clk(host))
		return 0;

	/*
	 * If clock scaling is already exited when resume is called, like
	 * during mmc shutdown, it is not an error and should not fail the
	 * API calling this.
	 */
	if (!host->clk_scaling.devfreq) {
		pr_err("%s: %s: no devfreq is assosiated with this device\n",
		pr_warn("%s: %s: no devfreq is assosiated with this device\n",
			mmc_hostname(host), __func__);
		return -EPERM;
		return 0;
	}

	atomic_set(&host->clk_scaling.devfreq_abort, 0);