base-files: define yes/no as valid boolean options
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0105-mtd-nand-pxa3xx-Check-for-clk_prepare_enable-return-.patch
1 From 7e8fbc673938278ec7165b99b76227d7cc2ab012 Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Wed, 17 Apr 2013 13:38:13 -0300
4 Subject: [PATCH 105/203] mtd: nand: pxa3xx: Check for clk_prepare_enable()
5  return value
6
7 clk_prepare_enable() can fail due to unknown reason.
8 Add a check for this and return the error code if it fails.
9
10 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
11 Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
12 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 ---
14  drivers/mtd/nand/pxa3xx_nand.c | 4 +++-
15  1 file changed, 3 insertions(+), 1 deletion(-)
16
17 --- a/drivers/mtd/nand/pxa3xx_nand.c
18 +++ b/drivers/mtd/nand/pxa3xx_nand.c
19 @@ -1072,7 +1072,9 @@ static int alloc_nand_resource(struct pl
20                 dev_err(&pdev->dev, "failed to get nand clock\n");
21                 return PTR_ERR(info->clk);
22         }
23 -       clk_prepare_enable(info->clk);
24 +       ret = clk_prepare_enable(info->clk);
25 +       if (ret < 0)
26 +               return ret;
27  
28         /*
29          * This is a dirty hack to make this driver work from devicetree