projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8fc0099
)
mmc: sh_mobile_sdhi: check return value when changing clk
author
Wolfram Sang
<
[email protected]
>
Mon, 2 May 2016 20:25:42 +0000
(22:25 +0200)
committer
Ulf Hansson
<
[email protected]
>
Wed, 4 May 2016 07:28:05 +0000
(09:28 +0200)
And return the old clock rate if something went wrong.
Signed-off-by: Wolfram Sang <
[email protected]
>
Tested-by: Geert Uytterhoeven <
[email protected]
>
Signed-off-by: Ulf Hansson <
[email protected]
>
drivers/mmc/host/sh_mobile_sdhi.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/host/sh_mobile_sdhi.c
b/drivers/mmc/host/sh_mobile_sdhi.c
index ac9ba36da39b5b56dfa4799298b0579a280cd6f8..5309c73be1f04fcffdea426519d37a5cfedbeb1e 100644
(file)
--- a/
drivers/mmc/host/sh_mobile_sdhi.c
+++ b/
drivers/mmc/host/sh_mobile_sdhi.c
@@
-166,7
+166,7
@@
static unsigned int sh_mobile_sdhi_clk_update(struct tmio_mmc_host *host,
{
struct sh_mobile_sdhi *priv = host_to_priv(host);
unsigned int freq, diff, best_freq = 0, diff_min = ~0;
- int i;
+ int i
, ret
;
/* tested only on RCar Gen2+ currently; may work for others */
if (!(host->pdata->flags & TMIO_MMC_MIN_RCAR2))
@@
-195,9
+195,9
@@
static unsigned int sh_mobile_sdhi_clk_update(struct tmio_mmc_host *host,
}
}
- clk_set_rate(priv->clk, best_freq);
+
ret =
clk_set_rate(priv->clk, best_freq);
- return
best_freq
;
+ return
ret == 0 ? best_freq : clk_get_rate(priv->clk)
;
}
static void sh_mobile_sdhi_clk_disable(struct tmio_mmc_host *host)