From: Jamie Iles Date: Tue, 11 Jan 2011 12:43:49 +0000 (+0000) Subject: mtd: mpc5121_nfc: don't treat NULL clk as an error X-Git-Tag: v2.6.39-rc1~40^2~44 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=83025c824fce44b6d007b9bbc506c4189fb89da1;p=karo-tx-linux.git mtd: mpc5121_nfc: 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 Reviewed-by: Wolfram Sang Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c index 469e649c911c..ddaf0011aa88 100644 --- a/drivers/mtd/nand/mpc5121_nfc.c +++ b/drivers/mtd/nand/mpc5121_nfc.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -758,9 +759,9 @@ static int __devinit mpc5121_nfc_probe(struct platform_device *op, /* Enable NFC clock */ prv->clk = clk_get(dev, "nfc_clk"); - if (!prv->clk) { + if (IS_ERR(prv->clk)) { dev_err(dev, "Unable to acquire NFC clock!\n"); - retval = -ENODEV; + retval = PTR_ERR(prv->clk); goto error; }