Skip to content

Commit 83025c8

Browse files
jamieilesDavid Woodhouse
authored andcommitted
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 <jamie@jamieiles.com> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent f53fdeb commit 83025c8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎drivers/mtd/nand/mpc5121_nfc.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/clk.h>
3030
#include <linux/gfp.h>
3131
#include <linux/delay.h>
32+
#include <linux/err.h>
3233
#include <linux/init.h>
3334
#include <linux/interrupt.h>
3435
#include <linux/io.h>
@@ -758,9 +759,9 @@ static int __devinit mpc5121_nfc_probe(struct platform_device *op,
758759

759760
/* Enable NFC clock */
760761
prv->clk = clk_get(dev, "nfc_clk");
761-
if (!prv->clk) {
762+
if (IS_ERR(prv->clk)) {
762763
dev_err(dev, "Unable to acquire NFC clock!\n");
763-
retval = -ENODEV;
764+
retval = PTR_ERR(prv->clk);
764765
goto error;
765766
}
766767

0 commit comments

Comments
 (0)