From: "Ira W. Snyder" <iws@ovro.caltech.edu>
To: dan.j.williams@intel.com
Cc: herbert@gondor.apana.org.au, B04825@freescale.com,
linuxppc-dev@ozlabs.org, Vishnu@freescale.com,
Dipen.Dudhat@freescale.com, Maneesh.Gupta@freescale.com,
R58472@freescale.com
Subject: [PATCH 2/8] fsldma: remove unused structure members
Date: Thu, 31 Dec 2009 22:10:40 -0800 [thread overview]
Message-ID: <1262326246-936-3-git-send-email-iws@ovro.caltech.edu> (raw)
In-Reply-To: <1262326246-936-1-git-send-email-iws@ovro.caltech.edu>
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>
---
drivers/dma/fsldma.c | 17 ++++++++---------
drivers/dma/fsldma.h | 4 ----
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 0bad741..0b4e638 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);
diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h
index 0df14cb..dbb5b5c 100644
--- a/drivers/dma/fsldma.h
+++ b/drivers/dma/fsldma.h
@@ -92,8 +92,6 @@ struct fsl_desc_sw {
struct list_head node;
struct list_head tx_list;
struct dma_async_tx_descriptor async_tx;
- struct list_head *ld;
- void *priv;
} __attribute__((aligned(32)));
struct fsl_dma_chan_regs {
@@ -111,7 +109,6 @@ struct fsl_dma_chan;
struct fsl_dma_device {
void __iomem *reg_base; /* DGSR register base */
- struct resource reg; /* Resource for register */
struct device *dev;
struct dma_device common;
struct fsl_dma_chan *chan[FSL_DMA_MAX_CHANS_PER_DEVICE];
@@ -138,7 +135,6 @@ struct fsl_dma_chan {
struct dma_chan common; /* DMA common channel */
struct dma_pool *desc_pool; /* Descriptors pool */
struct device *dev; /* Channel device */
- struct resource reg; /* Resource for register */
int irq; /* Channel IRQ */
int id; /* Raw id of this channel */
struct tasklet_struct tasklet;
--
1.5.4.3
next prev parent reply other threads:[~2010-01-01 6:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-01 6:10 fsldma: cleanup driver and fix async_tx compatibility Ira W. Snyder
2010-01-01 6:10 ` [PATCH 1/8] fsldma: reduce kernel text size Ira W. Snyder
2010-01-01 6:10 ` Ira W. Snyder [this message]
2010-01-01 6:10 ` [PATCH 3/8] fsldma: rename struct fsl_dma_chan to struct fsldma_chan Ira W. Snyder
2010-01-01 6:10 ` [PATCH 4/8] fsldma: rename dest to dst for uniformity Ira W. Snyder
2010-01-01 6:10 ` [PATCH 5/8] fsldma: clean up the OF subsystem routines Ira W. Snyder
2010-01-01 6:10 ` [PATCH 6/8] fsldma: simplify IRQ probing and handling Ira W. Snyder
2010-01-06 18:02 ` Scott Wood
2010-01-06 18:39 ` Ira W. Snyder
2010-01-06 20:51 ` Scott Wood
2010-01-01 6:10 ` [PATCH 7/8] fsldma: rename fsl_chan to fchan Ira W. Snyder
2010-01-06 18:04 ` Scott Wood
2010-01-06 18:19 ` Ira W. Snyder
2010-01-06 18:27 ` Scott Wood
2010-01-06 18:40 ` Ira W. Snyder
2010-01-01 6:10 ` [PATCH 8/8] fsldma: major cleanups and fixes Ira W. Snyder
2010-01-05 6:08 ` fsldma: cleanup driver and fix async_tx compatibility Dudhat Dipen-B09055
2010-01-11 5:47 ` Dudhat Dipen-B09055
2010-01-11 16:29 ` Ira W. Snyder
2010-02-02 7:50 ` Dudhat Dipen-B09055
2010-02-02 15:04 ` Dan Williams
2010-01-06 23:33 [PATCH 0/8 v2] " Ira W. Snyder
2010-01-06 23:34 ` [PATCH 2/8] fsldma: remove unused structure members Ira W. Snyder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1262326246-936-3-git-send-email-iws@ovro.caltech.edu \
--to=iws@ovro.caltech.edu \
--cc=B04825@freescale.com \
--cc=Dipen.Dudhat@freescale.com \
--cc=Maneesh.Gupta@freescale.com \
--cc=R58472@freescale.com \
--cc=Vishnu@freescale.com \
--cc=dan.j.williams@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).