lkml.org 
[lkml]   [2015]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectquestion about drivers/dma/dma-jz4780.c
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


\
 
 \ /
  Last update: 2015-07-19 11:41    [W:0.070 / U:1.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site