diff options
| author | Ezequiel Garcia <ezequiel.garcia@free-electrons.com> | 2013-04-17 12:38:13 -0400 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-08-05 15:47:48 -0400 |
| commit | 1f8eaff2aa75f8ec662e044deecdc91abc780d60 (patch) | |
| tree | c27f6fe842e2b2c6eb5e7f8344fdaef327c8a5e0 | |
| parent | fb32061ffaa9da61f72f79120a39729aa1736de0 (diff) | |
mtd: nand: pxa3xx: Check for clk_prepare_enable() return value
clk_prepare_enable() can fail due to unknown reason.
Add a check for this and return the error code if it fails.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| -rw-r--r-- | drivers/mtd/nand/pxa3xx_nand.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 1c03f9c73f8d..0f820caaa893 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c | |||
| @@ -1072,7 +1072,9 @@ static int alloc_nand_resource(struct platform_device *pdev) | |||
| 1072 | dev_err(&pdev->dev, "failed to get nand clock\n"); | 1072 | dev_err(&pdev->dev, "failed to get nand clock\n"); |
| 1073 | return PTR_ERR(info->clk); | 1073 | return PTR_ERR(info->clk); |
| 1074 | } | 1074 | } |
| 1075 | clk_prepare_enable(info->clk); | 1075 | ret = clk_prepare_enable(info->clk); |
| 1076 | if (ret < 0) | ||
| 1077 | return ret; | ||
| 1076 | 1078 | ||
| 1077 | /* | 1079 | /* |
| 1078 | * This is a dirty hack to make this driver work from devicetree | 1080 | * This is a dirty hack to make this driver work from devicetree |
