From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: vinod.koul@intel.com, dan.j.williams@intel.com
Cc: linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org
Subject: [PATCH 2/2] rcar-hpbdma: add parameter to set_slave() method
Date: Thu, 26 Sep 2013 02:31:37 +0400 [thread overview]
Message-ID: <201309260231.37773.sergei.shtylyov@cogentembedded.com> (raw)
Commit 4981c4dc194efb18f0e9a02f1b43e926f2f0d2bb (DMA: shdma: switch DT mode to
use configuration data from a match table) added a new parameter to set_slave()
method but unfortunately got merged later than commit c4f6c41ba790bbbfcebb4c47a
(dma: add driver for R-Car HPB-DMAC), so that the HPB-DMAC driver retained the
old prototype which caused this warning:
drivers/dma/sh/rcar-hpbdma.c:485: warning: initialization from incompatible
pointer type
The newly added parameter is used to override DMA slave address from 'struct
hpb_dmae_slave_config', so we have to add the 'slave_addr' field to 'struct
hpb_dmae_chan', conditionally assign it in set_slave() method, and return in
slave_addr() method.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against 'fixes-3.12' branch of Vinod Koul's 'slave-dma.git' repo.
drivers/dma/sh/rcar-hpbdma.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Index: slave-dma/drivers/dma/sh/rcar-hpbdma.c
===================================================================
--- slave-dma.orig/drivers/dma/sh/rcar-hpbdma.c
+++ slave-dma/drivers/dma/sh/rcar-hpbdma.c
@@ -93,6 +93,7 @@ struct hpb_dmae_chan {
void __iomem *base;
const struct hpb_dmae_slave_config *cfg;
char dev_id[16]; /* unique name per DMAC of channel */
+ dma_addr_t slave_addr;
};
struct hpb_dmae_device {
@@ -445,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb
return 0;
}
-static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try)
+static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id,
+ dma_addr_t slave_addr, bool try)
{
struct hpb_dmae_chan *chan = to_chan(schan);
const struct hpb_dmae_slave_config *sc =
@@ -456,6 +458,7 @@ static int hpb_dmae_set_slave(struct shd
if (try)
return 0;
chan->cfg = sc;
+ chan->slave_addr = slave_addr ? : sc->addr;
return hpb_dmae_alloc_chan_resources(chan, sc);
}
@@ -467,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(st
{
struct hpb_dmae_chan *chan = to_chan(schan);
- return chan->cfg->addr;
+ return chan->slave_addr;
}
static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i)
next reply other threads:[~2013-09-25 22:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-25 22:31 Sergei Shtylyov [this message]
2013-09-26 2:14 ` Simon Horman
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=201309260231.37773.sergei.shtylyov@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=vinod.koul@intel.com \
/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
all inboxes | Powered by JetHome®