提交 6b45c1ee 编写于 作者: E Ezequiel Garcia 提交者: David Woodhouse

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: NEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: NDaniel Mack <zonque@gmail.com>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 57ff88f0
...@@ -1141,30 +1141,35 @@ static int alloc_nand_resource(struct platform_device *pdev) ...@@ -1141,30 +1141,35 @@ static int alloc_nand_resource(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
return ret; return ret;
/* if (use_dma) {
* This is a dirty hack to make this driver work from devicetree /*
* bindings. It can be removed once we have a prober DMA controller * This is a dirty hack to make this driver work from
* framework for DT. * devicetree bindings. It can be removed once we have
*/ * a prober DMA controller framework for DT.
if (pdev->dev.of_node && of_machine_is_compatible("marvell,pxa3xx")) { */
info->drcmr_dat = 97; if (pdev->dev.of_node &&
info->drcmr_cmd = 99; of_machine_is_compatible("marvell,pxa3xx")) {
} else { info->drcmr_dat = 97;
r = platform_get_resource(pdev, IORESOURCE_DMA, 0); info->drcmr_cmd = 99;
if (r == NULL) { } else {
dev_err(&pdev->dev, "no resource defined for data DMA\n"); r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
ret = -ENXIO; if (r == NULL) {
goto fail_disable_clk; dev_err(&pdev->dev,
} "no resource defined for data DMA\n");
info->drcmr_dat = r->start; ret = -ENXIO;
goto fail_disable_clk;
r = platform_get_resource(pdev, IORESOURCE_DMA, 1); }
if (r == NULL) { info->drcmr_dat = r->start;
dev_err(&pdev->dev, "no resource defined for command DMA\n");
ret = -ENXIO; r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
goto fail_disable_clk; if (r == NULL) {
dev_err(&pdev->dev,
"no resource defined for cmd DMA\n");
ret = -ENXIO;
goto fail_disable_clk;
}
info->drcmr_cmd = r->start;
} }
info->drcmr_cmd = r->start;
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册