]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
fsldma: use a valid 'device' for dma_pool_create
authorDan Williams <dan.j.williams@intel.com>
Mon, 12 Jan 2009 22:18:34 +0000 (15:18 -0700)
committerDan Williams <dan.j.williams@intel.com>
Mon, 12 Jan 2009 22:20:42 +0000 (15:20 -0700)
The dmaengine sysfs implementation was fixed to support proper
lifetime rules which means that the current:

new_fsl_chan->dev = &new_fsl_chan->common.dev->device;

...retrieves a NULL pointer because new_fsl_chan->common.dev has not
been allocated at this point.  So, set new_fsl_chan->dev to a valid
device.

Cc: Li Yang <leoli@freescale.com>
Cc: Zhang Wei <zw@zh-kernel.org>
Reported-by: Ira Snyder <iws@ovro.caltech.edu>
Tested-by: Ira Snyder <iws@ovro.caltech.edu>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/fsldma.c

index ca70a21afc681ec04c1c230cf1a6ba3667aa1e11..748e140c5a184397895f2b31fc3414b7352e9af4 100644 (file)
@@ -822,7 +822,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
         */
        WARN_ON(fdev->feature != new_fsl_chan->feature);
 
-       new_fsl_chan->dev = &new_fsl_chan->common.dev->device;
+       new_fsl_chan->dev = fdev->dev;
        new_fsl_chan->reg_base = ioremap(new_fsl_chan->reg.start,
                        new_fsl_chan->reg.end - new_fsl_chan->reg.start + 1);