Skip to content

Commit

Permalink
usb: musb: musbhsdma: fix IRQ check
Browse files Browse the repository at this point in the history
dma_controller_create() in this MUSB DMA driver only regards 0 as a wrong IRQ
number, despite platform_get_irq_byname() that it calls returns -ENXIO in that
case. It leads to calling request_irq() with a negative IRQ number, and when it
naturally fails, the following is printed to the console:

request_irq -6 failed!

and the DMA controller is not created.

Fix this function to filter out the error values as well as 0.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Sergei Shtylyov authored and Felipe Balbi committed Sep 6, 2012
1 parent ff41aaa commit 7effdbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/musb/musbhsdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ dma_controller_create(struct musb *musb, void __iomem *base)
struct platform_device *pdev = to_platform_device(dev);
int irq = platform_get_irq_byname(pdev, "dma");

if (irq == 0) {
if (irq <= 0) {
dev_err(dev, "No DMA interrupt line!\n");
return NULL;
}
Expand Down

0 comments on commit 7effdbd

Please sign in to comment.