base-files: define yes/no as valid boolean options
[openwrt/staging/mkresin.git] / target / linux / mvebu / patches-3.10 / 0113-mtd-nand-use-dev_get_platdata.patch
1 From f37031e030eb05ba579c82b9e0424d2608c1ad67 Mon Sep 17 00:00:00 2001
2 From: Jingoo Han <jg1.han@samsung.com>
3 Date: Tue, 30 Jul 2013 17:18:33 +0900
4 Subject: [PATCH 113/203] mtd: nand: use dev_get_platdata()
5
6 Use the wrapper function for retrieving the platform data instead of
7 accessing dev->platform_data directly.
8
9 Signed-off-by: Jingoo Han <jg1.han@samsung.com>
10 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
11 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 ---
13 drivers/mtd/nand/pxa3xx_nand.c | 14 +++++++-------
14 1 file changed, 7 insertions(+), 7 deletions(-)
15
16 --- a/drivers/mtd/nand/pxa3xx_nand.c
17 +++ b/drivers/mtd/nand/pxa3xx_nand.c
18 @@ -815,7 +815,7 @@ static int pxa3xx_nand_config_flash(stru
19 const struct pxa3xx_nand_flash *f)
20 {
21 struct platform_device *pdev = info->pdev;
22 - struct pxa3xx_nand_platform_data *pdata = pdev->dev.platform_data;
23 + struct pxa3xx_nand_platform_data *pdata = dev_get_platdata(&pdev->dev);
24 struct pxa3xx_nand_host *host = info->host[info->cs];
25 uint32_t ndcr = 0x0; /* enable all interrupts */
26
27 @@ -958,7 +958,7 @@ static int pxa3xx_nand_scan(struct mtd_i
28 struct pxa3xx_nand_host *host = mtd->priv;
29 struct pxa3xx_nand_info *info = host->info_data;
30 struct platform_device *pdev = info->pdev;
31 - struct pxa3xx_nand_platform_data *pdata = pdev->dev.platform_data;
32 + struct pxa3xx_nand_platform_data *pdata = dev_get_platdata(&pdev->dev);
33 struct nand_flash_dev pxa3xx_flash_ids[2], *def = NULL;
34 const struct pxa3xx_nand_flash *f = NULL;
35 struct nand_chip *chip = mtd->priv;
36 @@ -1058,7 +1058,7 @@ static int alloc_nand_resource(struct pl
37 struct resource *r;
38 int ret, irq, cs;
39
40 - pdata = pdev->dev.platform_data;
41 + pdata = dev_get_platdata(&pdev->dev);
42 info = devm_kzalloc(&pdev->dev, sizeof(*info) + (sizeof(*mtd) +
43 sizeof(*host)) * pdata->num_cs, GFP_KERNEL);
44 if (!info)
45 @@ -1176,7 +1176,7 @@ static int pxa3xx_nand_remove(struct pla
46 if (!info)
47 return 0;
48
49 - pdata = pdev->dev.platform_data;
50 + pdata = dev_get_platdata(&pdev->dev);
51
52 irq = platform_get_irq(pdev, 0);
53 if (irq >= 0)
54 @@ -1239,7 +1239,7 @@ static int pxa3xx_nand_probe(struct plat
55 if (ret)
56 return ret;
57
58 - pdata = pdev->dev.platform_data;
59 + pdata = dev_get_platdata(&pdev->dev);
60 if (!pdata) {
61 dev_err(&pdev->dev, "no platform data defined\n");
62 return -ENODEV;
63 @@ -1286,7 +1286,7 @@ static int pxa3xx_nand_suspend(struct pl
64 struct mtd_info *mtd;
65 int cs;
66
67 - pdata = pdev->dev.platform_data;
68 + pdata = dev_get_platdata(&pdev->dev);
69 if (info->state) {
70 dev_err(&pdev->dev, "driver busy, state = %d\n", info->state);
71 return -EAGAIN;
72 @@ -1307,7 +1307,7 @@ static int pxa3xx_nand_resume(struct pla
73 struct mtd_info *mtd;
74 int cs;
75
76 - pdata = pdev->dev.platform_data;
77 + pdata = dev_get_platdata(&pdev->dev);
78 /* We don't want to handle interrupt without calling mtd routine */
79 disable_int(info, NDCR_INT_MASK);
80