Skip to content

Commit

Permalink
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Browse files Browse the repository at this point in the history
Pull slave-dmaengine fixes from Vinod Koul:
 "Another week, time to send another fixes request taking time out of
  extended weekend for the festivities in this part of the world.

  We have two fixes from Sergei for rcar driver and one fixing memory
  leak of edma driver by Geyslan"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dma: edma.c: remove edma_desc leakage
  rcar-hpbdma: add parameter to set_slave() method
  rcar-hpbdma: remove shdma_free_irq() calls
  • Loading branch information
Linus Torvalds committed Oct 13, 2013
2 parents 9d05746 + 2f6d8fa commit 75c5318
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions drivers/dma/edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
EDMA_SLOT_ANY);
if (echan->slot[i] < 0) {
dev_err(dev, "Failed to allocate slot\n");
kfree(edesc);
return NULL;
}
}
Expand Down
9 changes: 5 additions & 4 deletions drivers/dma/sh/rcar-hpbdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -432,7 +433,6 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan,
hpb_chan->xfer_mode = XFER_DOUBLE;
} else {
dev_err(hpb_chan->shdma_chan.dev, "DCR setting error");
shdma_free_irq(&hpb_chan->shdma_chan);
return -EINVAL;
}

Expand All @@ -446,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan,
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 =
Expand All @@ -457,6 +458,7 @@ static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try)
if (try)
return 0;
chan->cfg = sc;
chan->slave_addr = slave_addr ? : sc->addr;
return hpb_dmae_alloc_chan_resources(chan, sc);
}

Expand All @@ -468,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(struct shdma_chan *schan)
{
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)
Expand Down Expand Up @@ -614,7 +616,6 @@ static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev)
shdma_for_each_chan(schan, &hpbdev->shdma_dev, i) {
BUG_ON(!schan);

shdma_free_irq(schan);
shdma_chan_remove(schan);
}
dma_dev->chancnt = 0;
Expand Down

0 comments on commit 75c5318

Please sign in to comment.