1 From c26369f5b9929e1187ccf716d6d1678196ec0b4f Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Mon, 12 Aug 2013 14:14:58 -0300
4 Subject: [PATCH 125/203] mtd: nand: pxa3xx: Allow devices with no dma
7 When use_dma=0 there's no point in requesting resources for dma,
8 since they won't be used anyway. Therefore we remove that requirement,
9 therefore allowing devices without dma to pass the driver probe.
11 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
12 Tested-by: Daniel Mack <zonque@gmail.com>
13 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
14 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
16 drivers/mtd/nand/pxa3xx_nand.c | 51 +++++++++++++++++++++++-------------------
17 1 file changed, 28 insertions(+), 23 deletions(-)
19 --- a/drivers/mtd/nand/pxa3xx_nand.c
20 +++ b/drivers/mtd/nand/pxa3xx_nand.c
21 @@ -1141,30 +1141,35 @@ static int alloc_nand_resource(struct pl
26 - * This is a dirty hack to make this driver work from devicetree
27 - * bindings. It can be removed once we have a prober DMA controller
30 - if (pdev->dev.of_node && of_machine_is_compatible("marvell,pxa3xx")) {
31 - info->drcmr_dat = 97;
32 - info->drcmr_cmd = 99;
34 - r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
36 - dev_err(&pdev->dev, "no resource defined for data DMA\n");
38 - goto fail_disable_clk;
40 - info->drcmr_dat = r->start;
43 + * This is a dirty hack to make this driver work from
44 + * devicetree bindings. It can be removed once we have
45 + * a prober DMA controller framework for DT.
47 + if (pdev->dev.of_node &&
48 + of_machine_is_compatible("marvell,pxa3xx")) {
49 + info->drcmr_dat = 97;
50 + info->drcmr_cmd = 99;
52 + r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
55 + "no resource defined for data DMA\n");
57 + goto fail_disable_clk;
59 + info->drcmr_dat = r->start;
61 - r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
63 - dev_err(&pdev->dev, "no resource defined for command DMA\n");
65 - goto fail_disable_clk;
66 + r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
69 + "no resource defined for cmd DMA\n");
71 + goto fail_disable_clk;
73 + info->drcmr_cmd = r->start;
75 - info->drcmr_cmd = r->start;
78 irq = platform_get_irq(pdev, 0);