base-files: define yes/no as valid boolean options
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0136-mtd-nand-pxa3xx-Use-chip-cmdfunc-instead-of-the-inte.patch
1 From 67ab922e1e292494732a10f367d3de47338639ac Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Thu, 7 Nov 2013 12:17:15 -0300
4 Subject: [PATCH 136/203] mtd: nand: pxa3xx: Use chip->cmdfunc instead of the
5  internal
6
7 Whenever possible, it's always better to use the generic chip->cmdfunc
8 instead of the internal pxa3xx_nand_cmdfunc().
9 In this particular case, this will allow to have multiple cmdfunc()
10 implementations for different SoC variants.
11
12 Reviewed-by: Huang Shijie <shijie8@gmail.com>
13 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
14 Tested-by: Daniel Mack <zonque@gmail.com>
15 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
16 ---
17  drivers/mtd/nand/pxa3xx_nand.c | 6 +++++-
18  1 file changed, 5 insertions(+), 1 deletion(-)
19
20 --- a/drivers/mtd/nand/pxa3xx_nand.c
21 +++ b/drivers/mtd/nand/pxa3xx_nand.c
22 @@ -1015,14 +1015,18 @@ static void pxa3xx_nand_free_buff(struct
23  static int pxa3xx_nand_sensing(struct pxa3xx_nand_info *info)
24  {
25         struct mtd_info *mtd;
26 +       struct nand_chip *chip;
27         int ret;
28 +
29         mtd = info->host[info->cs]->mtd;
30 +       chip = mtd->priv;
31 +
32         /* use the common timing to make a try */
33         ret = pxa3xx_nand_config_flash(info, &builtin_flash_types[0]);
34         if (ret)
35                 return ret;
36  
37 -       pxa3xx_nand_cmdfunc(mtd, NAND_CMD_RESET, 0, 0);
38 +       chip->cmdfunc(mtd, NAND_CMD_RESET, 0, 0);
39         if (info->is_ready)
40                 return 0;
41