summaryrefslogtreecommitdiff
path: root/drivers/dma/fsldma.c
diff options
context:
space:
mode:
authorIra Snyder <iws@ovro.caltech.edu>2010-01-06 16:34:00 +0300
committerDan Williams <dan.j.williams@intel.com>2010-02-03 00:51:40 +0300
commit4ce0e953f6286777452bf07c83056342d6b9b257 (patch)
tree69a182aaa86cad2e8680132464b122374d7a53b0 /drivers/dma/fsldma.c
parent272ca655090978bdaa2630fc44fb2c03da5576fd (diff)
downloadlinux-4ce0e953f6286777452bf07c83056342d6b9b257.tar.xz
fsldma: remove unused structure members
Remove some unused members from the fsldma data structures. A few trivial uses of struct resource were converted to use the stack rather than keeping the memory allocated for the lifetime of the driver. Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/fsldma.c')
-rw-r--r--drivers/dma/fsldma.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 0bad741765c6..0b4e6383f480 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1072,6 +1072,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
struct device_node *node, u32 feature, const char *compatible)
{
struct fsl_dma_chan *new_fsl_chan;
+ struct resource res;
int err;
/* alloc channel */
@@ -1083,7 +1084,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
}
/* get dma channel register base */
- err = of_address_to_resource(node, 0, &new_fsl_chan->reg);
+ err = of_address_to_resource(node, 0, &res);
if (err) {
dev_err(fdev->dev, "Can't get %s property 'reg'\n",
node->full_name);
@@ -1101,10 +1102,8 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
WARN_ON(fdev->feature != new_fsl_chan->feature);
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);
-
- new_fsl_chan->id = ((new_fsl_chan->reg.start - 0x100) & 0xfff) >> 7;
+ new_fsl_chan->reg_base = ioremap(res.start, resource_size(&res));
+ new_fsl_chan->id = ((res.start - 0x100) & 0xfff) >> 7;
if (new_fsl_chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) {
dev_err(fdev->dev, "There is no %d channel!\n",
new_fsl_chan->id);
@@ -1183,6 +1182,7 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
int err;
struct fsl_dma_device *fdev;
struct device_node *child;
+ struct resource res;
fdev = kzalloc(sizeof(struct fsl_dma_device), GFP_KERNEL);
if (!fdev) {
@@ -1193,7 +1193,7 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
INIT_LIST_HEAD(&fdev->common.channels);
/* get DMA controller register base */
- err = of_address_to_resource(dev->node, 0, &fdev->reg);
+ err = of_address_to_resource(dev->node, 0, &res);
if (err) {
dev_err(&dev->dev, "Can't get %s property 'reg'\n",
dev->node->full_name);
@@ -1202,9 +1202,8 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
dev_info(&dev->dev, "Probe the Freescale DMA driver for %s "
"controller at 0x%llx...\n",
- match->compatible, (unsigned long long)fdev->reg.start);
- fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end
- - fdev->reg.start + 1);
+ match->compatible, (unsigned long long)res.start);
+ fdev->reg_base = ioremap(res.start, resource_size(&res));
dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask);
dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask);