提交 3738ca1b 编写于 作者: R Robert Jarzmik

ARM: pxa: pxa_cplds: honor probe deferral

The method to acquire the input interrupt was working in a platform data
based board, but was failing in a device-tree one when the gpio
controller was probed after pxa_cplds.

Use platform_get_irq() to benefit from the probe deferral
mechanism. Moreover, as seen in dm9000.c development, platform_get_irq()
doesn't honor the irq type IO resource (ie. edge rising for example),
and it must be passed again at irq request in a not device-tree build,
hence the irq_get_trigger_type() call.
Signed-off-by: NRobert Jarzmik <robert.jarzmik@free.fr>
上级 d3570e3c
...@@ -120,13 +120,9 @@ static int cplds_probe(struct platform_device *pdev) ...@@ -120,13 +120,9 @@ static int cplds_probe(struct platform_device *pdev)
if (!fpga) if (!fpga)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); fpga->irq = platform_get_irq(pdev, 0);
if (res) { if (fpga->irq <= 0)
fpga->irq = (unsigned int)res->start; return fpga->irq;
irqflags = res->flags;
}
if (!fpga->irq)
return -ENODEV;
base_irq = platform_get_irq(pdev, 1); base_irq = platform_get_irq(pdev, 1);
if (base_irq < 0) if (base_irq < 0)
...@@ -142,6 +138,7 @@ static int cplds_probe(struct platform_device *pdev) ...@@ -142,6 +138,7 @@ static int cplds_probe(struct platform_device *pdev)
writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN); writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN);
writel(0, fpga->base + FPGA_IRQ_SET_CLR); writel(0, fpga->base + FPGA_IRQ_SET_CLR);
irqflags = irq_get_trigger_type(fpga->irq);
ret = devm_request_irq(&pdev->dev, fpga->irq, cplds_irq_handler, ret = devm_request_irq(&pdev->dev, fpga->irq, cplds_irq_handler,
irqflags, dev_name(&pdev->dev), fpga); irqflags, dev_name(&pdev->dev), fpga);
if (ret == -ENOSYS) if (ret == -ENOSYS)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册