提交 9097103f 编写于 作者: R Robert Jarzmik 提交者: Brian Norris

mtd: nand: pxa3xx_nand: fix dmaengine initialization

When the driver is initialized in a pure device-tree platform, the
driver's probe fails allocating the dma channel :
[  525.624435] pxa3xx-nand 43100000.nand: no resource defined for data DMA
[  525.632088] pxa3xx-nand 43100000.nand: alloc nand resource failed

The reason is that the DMA IO resource is not acquired through platform
resources but by OF bindings.

Fix this by ensuring that DMA IO resources are only queried in the non
device-tree case.

Fixes: 8f5ba31a ("mtd: nand: pxa3xx-nand: switch to dmaengine")
Signed-off-by: NRobert Jarzmik <robert.jarzmik@free.fr>
Acked-by: NEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 f671a1f3
...@@ -1795,7 +1795,7 @@ static int alloc_nand_resource(struct platform_device *pdev) ...@@ -1795,7 +1795,7 @@ static int alloc_nand_resource(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
return ret; return ret;
if (use_dma) { if (!np && use_dma) {
r = platform_get_resource(pdev, IORESOURCE_DMA, 0); r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (r == NULL) { if (r == NULL) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册