Skip to content

Commit

Permalink
mtd: mpc5121_nfc: don't treat NULL clk as an error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jamie Iles authored and David Woodhouse committed Mar 11, 2011
1 parent f53fdeb commit 83025c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/mtd/nand/mpc5121_nfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/clk.h>
#include <linux/gfp.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 83025c8

Please sign in to comment.