From: Jamie Iles Date: Tue, 11 Jan 2011 12:43:50 +0000 (+0000) Subject: mmc: jz4740: don't treat NULL clk as an error X-Git-Tag: v3.0~1944^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3119cbda858fc9ae10a69919e5f278abd6d93bb5;p=platform%2Fkernel%2Flinux-amlogic.git mmc: jz4740: don't treat NULL clk as an error clk_get() returns a struct clk cookie to the driver and some platforms may return NULL if they only support a single clock. clk_get() has only failed if it returns a ERR_PTR() encoded pointer. Signed-off-by: Jamie Iles Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c index b3a0ab0..74218ad 100644 --- a/drivers/mmc/host/jz4740_mmc.c +++ b/drivers/mmc/host/jz4740_mmc.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -827,8 +828,8 @@ static int __devinit jz4740_mmc_probe(struct platform_device* pdev) } host->clk = clk_get(&pdev->dev, "mmc"); - if (!host->clk) { - ret = -ENOENT; + if (IS_ERR(host->clk)) { + ret = PTR_ERR(host->clk); dev_err(&pdev->dev, "Failed to get mmc clock\n"); goto err_free_host; }