diff options
author | Ezequiel Garcia <ezequiel.garcia@free-electrons.com> | 2013-08-12 13:14:58 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-08-30 16:35:02 -0400 |
commit | 6b45c1eef6d19d3a6af43471c70235cbe967b491 (patch) | |
tree | 947ad9bf9356a1daea9eff5ad6157e78921ec096 /drivers/mtd | |
parent | 57ff88f0f961348a1dec024d611ec7e281510529 (diff) |
mtd: nand: pxa3xx: Allow devices with no dma resources
When use_dma=0 there's no point in requesting resources for dma,
since they won't be used anyway. Therefore we remove that requirement,
therefore allowing devices without dma to pass the driver probe.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/pxa3xx_nand.c | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index d14933c3a75d..5db900d917f9 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c | |||
@@ -1141,30 +1141,35 @@ static int alloc_nand_resource(struct platform_device *pdev) | |||
1141 | if (ret < 0) | 1141 | if (ret < 0) |
1142 | return ret; | 1142 | return ret; |
1143 | 1143 | ||
1144 | /* | 1144 | if (use_dma) { |
1145 | * This is a dirty hack to make this driver work from devicetree | 1145 | /* |
1146 | * bindings. It can be removed once we have a prober DMA controller | 1146 | * This is a dirty hack to make this driver work from |
1147 | * framework for DT. | 1147 | * devicetree bindings. It can be removed once we have |
1148 | */ | 1148 | * a prober DMA controller framework for DT. |
1149 | if (pdev->dev.of_node && of_machine_is_compatible("marvell,pxa3xx")) { | 1149 | */ |
1150 | info->drcmr_dat = 97; | 1150 | if (pdev->dev.of_node && |
1151 | info->drcmr_cmd = 99; | 1151 | of_machine_is_compatible("marvell,pxa3xx")) { |
1152 | } else { | 1152 | info->drcmr_dat = 97; |
1153 | r = platform_get_resource(pdev, IORESOURCE_DMA, 0); | 1153 | info->drcmr_cmd = 99; |
1154 | if (r == NULL) { | 1154 | } else { |
1155 | dev_err(&pdev->dev, "no resource defined for data DMA\n"); | 1155 | r = platform_get_resource(pdev, IORESOURCE_DMA, 0); |
1156 | ret = -ENXIO; | 1156 | if (r == NULL) { |
1157 | goto fail_disable_clk; | 1157 | dev_err(&pdev->dev, |
1158 | } | 1158 | "no resource defined for data DMA\n"); |
1159 | info->drcmr_dat = r->start; | 1159 | ret = -ENXIO; |
1160 | 1160 | goto fail_disable_clk; | |
1161 | r = platform_get_resource(pdev, IORESOURCE_DMA, 1); | 1161 | } |
1162 | if (r == NULL) { | 1162 | info->drcmr_dat = r->start; |
1163 | dev_err(&pdev->dev, "no resource defined for command DMA\n"); | 1163 | |
1164 | ret = -ENXIO; | 1164 | r = platform_get_resource(pdev, IORESOURCE_DMA, 1); |
1165 | goto fail_disable_clk; | 1165 | if (r == NULL) { |
1166 | dev_err(&pdev->dev, | ||
1167 | "no resource defined for cmd DMA\n"); | ||
1168 | ret = -ENXIO; | ||
1169 | goto fail_disable_clk; | ||
1170 | } | ||
1171 | info->drcmr_cmd = r->start; | ||
1166 | } | 1172 | } |
1167 | info->drcmr_cmd = r->start; | ||
1168 | } | 1173 | } |
1169 | 1174 | ||
1170 | irq = platform_get_irq(pdev, 0); | 1175 | irq = platform_get_irq(pdev, 0); |