public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* question about drivers/dma/dma-jz4780.c
@ 2015-07-19  9:08 Julia Lawall
  2015-07-20  8:18 ` Alex Smith
  0 siblings, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2015-07-19  9:08 UTC (permalink / raw)
  To: Zubair.Kakakhel; +Cc: dmaengine, linux-kernel

The file drivers/dma/dma-jz4780.c has a probe function that sets up irqs 
using devm_request_irq.  The probe function then ends with:

err_unregister_dev:
	dma_async_device_unregister(dd);

err_disable_clk:
        clk_disable_unprepare(jzdma->clk);
	return ret;
}

The remove function, on the other hand contains:

        of_dma_controller_free(pdev->dev.of_node);
        devm_free_irq(&pdev->dev, jzdma->irq, jzdma);
        dma_async_device_unregister(&jzdma->dma_device);

The need for calling devm_free_irq explicitly would be that it needs to 
occur before dma_async_device_unregister, to eg avoid a reference to a 
dangling pointer.  But devm_free_irq is implicitly called after the call 
to dma_async_device_unregister at the end of the probe function.  Which 
one is correct?

julia

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-07-24  8:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-19  9:08 question about drivers/dma/dma-jz4780.c Julia Lawall
2015-07-20  8:18 ` Alex Smith
2015-07-20  8:28   ` Julia Lawall
2015-07-21  4:15     ` Vinod Koul
2015-07-22 14:26       ` Alex Smith
2015-07-23 17:21         ` Vinod Koul
2015-07-23 17:24           ` Julia Lawall
2015-07-24  5:42             ` Vinod Koul
2015-07-24  5:51               ` Julia Lawall
2015-07-24  6:30                 ` Vinod Koul
2015-07-24  6:49                   ` Julia Lawall
2015-07-24  8:28                   ` Alex Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox