Commit 4ce0e953 authored by Ira Snyder's avatar Ira Snyder Committed by Dan Williams

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: default avatarIra W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 272ca655
...@@ -1072,6 +1072,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev, ...@@ -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 device_node *node, u32 feature, const char *compatible)
{ {
struct fsl_dma_chan *new_fsl_chan; struct fsl_dma_chan *new_fsl_chan;
struct resource res;
int err; int err;
/* alloc channel */ /* alloc channel */
...@@ -1083,7 +1084,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev, ...@@ -1083,7 +1084,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
} }
/* get dma channel register base */ /* 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) { if (err) {
dev_err(fdev->dev, "Can't get %s property 'reg'\n", dev_err(fdev->dev, "Can't get %s property 'reg'\n",
node->full_name); node->full_name);
...@@ -1101,10 +1102,8 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev, ...@@ -1101,10 +1102,8 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
WARN_ON(fdev->feature != new_fsl_chan->feature); WARN_ON(fdev->feature != new_fsl_chan->feature);
new_fsl_chan->dev = fdev->dev; new_fsl_chan->dev = fdev->dev;
new_fsl_chan->reg_base = ioremap(new_fsl_chan->reg.start, new_fsl_chan->reg_base = ioremap(res.start, resource_size(&res));
new_fsl_chan->reg.end - new_fsl_chan->reg.start + 1); new_fsl_chan->id = ((res.start - 0x100) & 0xfff) >> 7;
new_fsl_chan->id = ((new_fsl_chan->reg.start - 0x100) & 0xfff) >> 7;
if (new_fsl_chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) { if (new_fsl_chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) {
dev_err(fdev->dev, "There is no %d channel!\n", dev_err(fdev->dev, "There is no %d channel!\n",
new_fsl_chan->id); new_fsl_chan->id);
...@@ -1183,6 +1182,7 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev, ...@@ -1183,6 +1182,7 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
int err; int err;
struct fsl_dma_device *fdev; struct fsl_dma_device *fdev;
struct device_node *child; struct device_node *child;
struct resource res;
fdev = kzalloc(sizeof(struct fsl_dma_device), GFP_KERNEL); fdev = kzalloc(sizeof(struct fsl_dma_device), GFP_KERNEL);
if (!fdev) { if (!fdev) {
...@@ -1193,7 +1193,7 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev, ...@@ -1193,7 +1193,7 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
INIT_LIST_HEAD(&fdev->common.channels); INIT_LIST_HEAD(&fdev->common.channels);
/* get DMA controller register base */ /* 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) { if (err) {
dev_err(&dev->dev, "Can't get %s property 'reg'\n", dev_err(&dev->dev, "Can't get %s property 'reg'\n",
dev->node->full_name); dev->node->full_name);
...@@ -1202,9 +1202,8 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev, ...@@ -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 " dev_info(&dev->dev, "Probe the Freescale DMA driver for %s "
"controller at 0x%llx...\n", "controller at 0x%llx...\n",
match->compatible, (unsigned long long)fdev->reg.start); match->compatible, (unsigned long long)res.start);
fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end fdev->reg_base = ioremap(res.start, resource_size(&res));
- fdev->reg.start + 1);
dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask); dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask);
dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask); dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask);
......
...@@ -92,8 +92,6 @@ struct fsl_desc_sw { ...@@ -92,8 +92,6 @@ struct fsl_desc_sw {
struct list_head node; struct list_head node;
struct list_head tx_list; struct list_head tx_list;
struct dma_async_tx_descriptor async_tx; struct dma_async_tx_descriptor async_tx;
struct list_head *ld;
void *priv;
} __attribute__((aligned(32))); } __attribute__((aligned(32)));
struct fsl_dma_chan_regs { struct fsl_dma_chan_regs {
...@@ -111,7 +109,6 @@ struct fsl_dma_chan; ...@@ -111,7 +109,6 @@ struct fsl_dma_chan;
struct fsl_dma_device { struct fsl_dma_device {
void __iomem *reg_base; /* DGSR register base */ void __iomem *reg_base; /* DGSR register base */
struct resource reg; /* Resource for register */
struct device *dev; struct device *dev;
struct dma_device common; struct dma_device common;
struct fsl_dma_chan *chan[FSL_DMA_MAX_CHANS_PER_DEVICE]; struct fsl_dma_chan *chan[FSL_DMA_MAX_CHANS_PER_DEVICE];
...@@ -138,7 +135,6 @@ struct fsl_dma_chan { ...@@ -138,7 +135,6 @@ struct fsl_dma_chan {
struct dma_chan common; /* DMA common channel */ struct dma_chan common; /* DMA common channel */
struct dma_pool *desc_pool; /* Descriptors pool */ struct dma_pool *desc_pool; /* Descriptors pool */
struct device *dev; /* Channel device */ struct device *dev; /* Channel device */
struct resource reg; /* Resource for register */
int irq; /* Channel IRQ */ int irq; /* Channel IRQ */
int id; /* Raw id of this channel */ int id; /* Raw id of this channel */
struct tasklet_struct tasklet; struct tasklet_struct tasklet;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment