[lkml]   [2008]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] fsl-dma: allow Freescale Elo DMA driver to be compiled as a module
    Dan Williams wrote:

    > The last three hunks should be broken out into a separate 'fix' patch
    > with its own changelog.

    Can you be more specific? I can see how "return 0" -> "return -ENOMEM" could be
    separated out, but the Kconfig hunk is integral to the patch, and the "if
    (fsl_chan->desc_pool) return 1;" is needed to prevent a memory leak if the
    module is unloaded.

    >> -static __init int of_fsl_dma_chan_init(void)
    >> +static void fsl_dma_chan_remove(struct fsl_dma_chan *fchan)
    >> {
    >> - return of_register_platform_driver(&of_fsl_dma_chan_driver);
    >> + if (fchan) {
    >> + of_device_unregister(fchan->of_dev);
    >> +
    >> + free_irq(fchan->irq, fchan);
    >> + list_del(&fchan->common.device_node);
    >> + iounmap(fchan->reg_base);
    >> + kfree(fchan);
    >> + }
    >> }
    > removing a NULL fchan should be an error right?

    No, this is a side-effect of not using a linked-list to store the channels found
    by the driver. The driver has a 4-element array to store the channel info.
    Normally, all four channels are defined in the OF device tree, so all four
    elements are defined. But it's not a requirement, so in those cases, the
    non-defined channels will have NULL for fchan.

    I have plans to replace the array with a linked list. This change will fix a
    few other minor problems with the driver.

    > Perhaps move the
    > check up to of_fsl_dma_remove().

    I can do that.

    Timur Tabi
    Linux kernel developer at Freescale

     \ /
      Last update: 2008-09-22 23:03    [W:0.033 / U:9.076 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site