aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorIra Snyder <iws@ovro.caltech.edu>2010-01-06 08:34:00 -0500
committerDan Williams <dan.j.williams@intel.com>2010-02-02 16:51:40 -0500
commit4ce0e953f6286777452bf07c83056342d6b9b257 (patch)
tree69a182aaa86cad2e8680132464b122374d7a53b0 /drivers/dma
parent272ca655090978bdaa2630fc44fb2c03da5576fd (diff)
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')
-rw-r--r--drivers/dma/fsldma.c17
-rw-r--r--drivers/dma/fsldma.h4
2 files changed, 8 insertions, 13 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 0bad741765c..0b4e6383f48 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,
1072 struct device_node *node, u32 feature, const char *compatible) 1072 struct device_node *node, u32 feature, const char *compatible)
1073{ 1073{
1074 struct fsl_dma_chan *new_fsl_chan; 1074 struct fsl_dma_chan *new_fsl_chan;
1075 struct resource res;
1075 int err; 1076 int err;
1076 1077
1077 /* alloc channel */ 1078 /* alloc channel */
@@ -1083,7 +1084,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
1083 } 1084 }
1084 1085
1085 /* get dma channel register base */ 1086 /* get dma channel register base */
1086 err = of_address_to_resource(node, 0, &new_fsl_chan->reg); 1087 err = of_address_to_resource(node, 0, &res);
1087 if (err) { 1088 if (err) {
1088 dev_err(fdev->dev, "Can't get %s property 'reg'\n", 1089 dev_err(fdev->dev, "Can't get %s property 'reg'\n",
1089 node->full_name); 1090 node->full_name);
@@ -1101,10 +1102,8 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
1101 WARN_ON(fdev->feature != new_fsl_chan->feature); 1102 WARN_ON(fdev->feature != new_fsl_chan->feature);
1102 1103
1103 new_fsl_chan->dev = fdev->dev; 1104 new_fsl_chan->dev = fdev->dev;
1104 new_fsl_chan->reg_base = ioremap(new_fsl_chan->reg.start, 1105 new_fsl_chan->reg_base = ioremap(res.start, resource_size(&res));
1105 new_fsl_chan->reg.end - new_fsl_chan->reg.start + 1); 1106 new_fsl_chan->id = ((res.start - 0x100) & 0xfff) >> 7;
1106
1107 new_fsl_chan->id = ((new_fsl_chan->reg.start - 0x100) & 0xfff) >> 7;
1108 if (new_fsl_chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) { 1107 if (new_fsl_chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) {
1109 dev_err(fdev->dev, "There is no %d channel!\n", 1108 dev_err(fdev->dev, "There is no %d channel!\n",
1110 new_fsl_chan->id); 1109 new_fsl_chan->id);
@@ -1183,6 +1182,7 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
1183 int err; 1182 int err;
1184 struct fsl_dma_device *fdev; 1183 struct fsl_dma_device *fdev;
1185 struct device_node *child; 1184 struct device_node *child;
1185 struct resource res;
1186 1186
1187 fdev = kzalloc(sizeof(struct fsl_dma_device), GFP_KERNEL); 1187 fdev = kzalloc(sizeof(struct fsl_dma_device), GFP_KERNEL);
1188 if (!fdev) { 1188 if (!fdev) {
@@ -1193,7 +1193,7 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
1193 INIT_LIST_HEAD(&fdev->common.channels); 1193 INIT_LIST_HEAD(&fdev->common.channels);
1194 1194
1195 /* get DMA controller register base */ 1195 /* get DMA controller register base */
1196 err = of_address_to_resource(dev->node, 0, &fdev->reg); 1196 err = of_address_to_resource(dev->node, 0, &res);
1197 if (err) { 1197 if (err) {
1198 dev_err(&dev->dev, "Can't get %s property 'reg'\n", 1198 dev_err(&dev->dev, "Can't get %s property 'reg'\n",
1199 dev->node->full_name); 1199 dev->node->full_name);
@@ -1202,9 +1202,8 @@ static int __devinit of_fsl_dma_probe(struct of_device *dev,
1202 1202
1203 dev_info(&dev->dev, "Probe the Freescale DMA driver for %s " 1203 dev_info(&dev->dev, "Probe the Freescale DMA driver for %s "
1204 "controller at 0x%llx...\n", 1204 "controller at 0x%llx...\n",
1205 match->compatible, (unsigned long long)fdev->reg.start); 1205 match->compatible, (unsigned long long)res.start);
1206 fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end 1206 fdev->reg_base = ioremap(res.start, resource_size(&res));
1207 - fdev->reg.start + 1);
1208 1207
1209 dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask); 1208 dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask);
1210 dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask); 1209 dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask);
diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h
index 0df14cbb8ca..dbb5b5cce4c 100644
--- a/drivers/dma/fsldma.h
+++ b/drivers/dma/fsldma.h
@@ -92,8 +92,6 @@ struct fsl_desc_sw {
92 struct list_head node; 92 struct list_head node;
93 struct list_head tx_list; 93 struct list_head tx_list;
94 struct dma_async_tx_descriptor async_tx; 94 struct dma_async_tx_descriptor async_tx;
95 struct list_head *ld;
96 void *priv;
97} __attribute__((aligned(32))); 95} __attribute__((aligned(32)));
98 96
99struct fsl_dma_chan_regs { 97struct fsl_dma_chan_regs {
@@ -111,7 +109,6 @@ struct fsl_dma_chan;
111 109
112struct fsl_dma_device { 110struct fsl_dma_device {
113 void __iomem *reg_base; /* DGSR register base */ 111 void __iomem *reg_base; /* DGSR register base */
114 struct resource reg; /* Resource for register */
115 struct device *dev; 112 struct device *dev;
116 struct dma_device common; 113 struct dma_device common;
117 struct fsl_dma_chan *chan[FSL_DMA_MAX_CHANS_PER_DEVICE]; 114 struct fsl_dma_chan *chan[FSL_DMA_MAX_CHANS_PER_DEVICE];
@@ -138,7 +135,6 @@ struct fsl_dma_chan {
138 struct dma_chan common; /* DMA common channel */ 135 struct dma_chan common; /* DMA common channel */
139 struct dma_pool *desc_pool; /* Descriptors pool */ 136 struct dma_pool *desc_pool; /* Descriptors pool */
140 struct device *dev; /* Channel device */ 137 struct device *dev; /* Channel device */
141 struct resource reg; /* Resource for register */
142 int irq; /* Channel IRQ */ 138 int irq; /* Channel IRQ */
143 int id; /* Raw id of this channel */ 139 int id; /* Raw id of this channel */
144 struct tasklet_struct tasklet; 140 struct tasklet_struct tasklet;