Skip to content

Commit 2ca265e

Browse files
mnaranigregkh
authored andcommitted
mmc: sdhci-of-arasan: Check return value of non-void funtions
[ Upstream commit 66bad6e ] At a couple of places, the return values of the non-void functions were not getting checked. This was reported by the coverity tool. Modify the code to check the return values of the same. Addresses-Coverity: ("check_return") Signed-off-by: Manish Narani <manish.narani@xilinx.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/1623753837-21035-5-git-send-email-manish.narani@xilinx.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 37c9af8 commit 2ca265e

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

‎drivers/mmc/host/sdhci-of-arasan.c‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,12 @@ static void sdhci_arasan_set_clock(struct sdhci_host *host, unsigned int clock)
273273
* through low speeds without power cycling.
274274
*/
275275
sdhci_set_clock(host, host->max_clk);
276-
phy_power_on(sdhci_arasan->phy);
276+
if (phy_power_on(sdhci_arasan->phy)) {
277+
pr_err("%s: Cannot power on phy.\n",
278+
mmc_hostname(host->mmc));
279+
return;
280+
}
281+
277282
sdhci_arasan->is_phy_on = true;
278283

279284
/*
@@ -323,7 +328,12 @@ static void sdhci_arasan_set_clock(struct sdhci_host *host, unsigned int clock)
323328
msleep(20);
324329

325330
if (ctrl_phy) {
326-
phy_power_on(sdhci_arasan->phy);
331+
if (phy_power_on(sdhci_arasan->phy)) {
332+
pr_err("%s: Cannot power on phy.\n",
333+
mmc_hostname(host->mmc));
334+
return;
335+
}
336+
327337
sdhci_arasan->is_phy_on = true;
328338
}
329339
}
@@ -479,7 +489,9 @@ static int sdhci_arasan_suspend(struct device *dev)
479489
ret = phy_power_off(sdhci_arasan->phy);
480490
if (ret) {
481491
dev_err(dev, "Cannot power off phy.\n");
482-
sdhci_resume_host(host);
492+
if (sdhci_resume_host(host))
493+
dev_err(dev, "Cannot resume host.\n");
494+
483495
return ret;
484496
}
485497
sdhci_arasan->is_phy_on = false;

0 commit comments

Comments
 (0)