Commit 8f4b78d9 authored by Tomasz Figa's avatar Tomasz Figa Committed by Chris Ball

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: default avatarTomasz Figa <tomasz.figa@gmail.com>
Tested-by: default avatarHeiko Stuebner <heiko@sntech.de>
Acked-by: default avatarHeiko Stuebner <heiko@sntech.de>
Tested-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
Acked-by; Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: default avatarChris Ball <chris@printf.net>
parent 6eb28bdc
...@@ -147,7 +147,7 @@ static unsigned int sdhci_s3c_consider_clock(struct sdhci_s3c *ourhost, ...@@ -147,7 +147,7 @@ static unsigned int sdhci_s3c_consider_clock(struct sdhci_s3c *ourhost,
struct clk *clksrc = ourhost->clk_bus[src]; struct clk *clksrc = ourhost->clk_bus[src];
int shift; int shift;
if (!clksrc) if (IS_ERR(clksrc))
return UINT_MAX; return UINT_MAX;
/* /*
...@@ -567,16 +567,14 @@ static int sdhci_s3c_probe(struct platform_device *pdev) ...@@ -567,16 +567,14 @@ static int sdhci_s3c_probe(struct platform_device *pdev)
clk_prepare_enable(sc->clk_io); clk_prepare_enable(sc->clk_io);
for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) { for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
struct clk *clk;
char name[14]; char name[14];
snprintf(name, 14, "mmc_busclk.%d", ptr); snprintf(name, 14, "mmc_busclk.%d", ptr);
clk = devm_clk_get(dev, name); sc->clk_bus[ptr] = devm_clk_get(dev, name);
if (IS_ERR(clk)) if (IS_ERR(sc->clk_bus[ptr]))
continue; continue;
clks++; clks++;
sc->clk_bus[ptr] = clk;
/* /*
* save current clock index to know which clock bus * save current clock index to know which clock bus
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment