diff options
author | Tomasz Figa <tomasz.figa@gmail.com> | 2014-01-11 22:39:03 +0100 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-03-03 16:23:22 +0100 |
commit | 8f4b78d9bb042aacce43e0213c727da861a128f6 (patch) | |
tree | a5bbebacd0a16499c395128eacfc5074848f5b9b /drivers/mmc/host | |
parent | mmc: sdhci-s3c: Cache bus clock rates (diff) | |
download | linux-8f4b78d9bb042aacce43e0213c727da861a128f6.tar.xz linux-8f4b78d9bb042aacce43e0213c727da861a128f6.zip |
mmc: sdhci-s3c: Use correct condition to check for clock presence
IS_ERR() must be used to make sure that not a valid clock was returned
by clk_get() and company.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by; Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/sdhci-s3c.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 9b783915b02a..7fde938facb0 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -147,7 +147,7 @@ static unsigned int sdhci_s3c_consider_clock(struct sdhci_s3c *ourhost, struct clk *clksrc = ourhost->clk_bus[src]; int shift; - if (!clksrc) + if (IS_ERR(clksrc)) return UINT_MAX; /* @@ -567,16 +567,14 @@ static int sdhci_s3c_probe(struct platform_device *pdev) clk_prepare_enable(sc->clk_io); for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) { - struct clk *clk; char name[14]; snprintf(name, 14, "mmc_busclk.%d", ptr); - clk = devm_clk_get(dev, name); - if (IS_ERR(clk)) + sc->clk_bus[ptr] = devm_clk_get(dev, name); + if (IS_ERR(sc->clk_bus[ptr])) continue; clks++; - sc->clk_bus[ptr] = clk; /* * save current clock index to know which clock bus |