Skip to content

Commit 08d08bc

Browse files
Sergei ShtylyovVinod Koul
authored andcommitted
rcar-hpbdma: add parameter to set_slave() method
Commit 4981c4d (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 c4f6c41 (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 <[email protected]> Tested-by: Simon Horman <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
1 parent cdeb5c0 commit 08d08bc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/dma/sh/rcar-hpbdma.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ struct hpb_dmae_chan {
9393
void __iomem *base;
9494
const struct hpb_dmae_slave_config *cfg;
9595
char dev_id[16]; /* unique name per DMAC of channel */
96+
dma_addr_t slave_addr;
9697
};
9798

9899
struct hpb_dmae_device {
@@ -445,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan,
445446
return 0;
446447
}
447448

448-
static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try)
449+
static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id,
450+
dma_addr_t slave_addr, bool try)
449451
{
450452
struct hpb_dmae_chan *chan = to_chan(schan);
451453
const struct hpb_dmae_slave_config *sc =
@@ -456,6 +458,7 @@ static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try)
456458
if (try)
457459
return 0;
458460
chan->cfg = sc;
461+
chan->slave_addr = slave_addr ? : sc->addr;
459462
return hpb_dmae_alloc_chan_resources(chan, sc);
460463
}
461464

@@ -467,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(struct shdma_chan *schan)
467470
{
468471
struct hpb_dmae_chan *chan = to_chan(schan);
469472

470-
return chan->cfg->addr;
473+
return chan->slave_addr;
471474
}
472475

473476
static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i)

0 commit comments

Comments
 (0)