diff options
-rw-r--r-- | drivers/dma/edma.c | 1 | ||||
-rw-r--r-- | drivers/dma/sh/rcar-hpbdma.c | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 098a8da450f0..3519111c566b 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c | |||
@@ -306,6 +306,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( | |||
306 | EDMA_SLOT_ANY); | 306 | EDMA_SLOT_ANY); |
307 | if (echan->slot[i] < 0) { | 307 | if (echan->slot[i] < 0) { |
308 | dev_err(dev, "Failed to allocate slot\n"); | 308 | dev_err(dev, "Failed to allocate slot\n"); |
309 | kfree(edesc); | ||
309 | return NULL; | 310 | return NULL; |
310 | } | 311 | } |
311 | } | 312 | } |
diff --git a/drivers/dma/sh/rcar-hpbdma.c b/drivers/dma/sh/rcar-hpbdma.c index 45a520281ce1..ebad84591a6e 100644 --- a/drivers/dma/sh/rcar-hpbdma.c +++ b/drivers/dma/sh/rcar-hpbdma.c | |||
@@ -93,6 +93,7 @@ struct hpb_dmae_chan { | |||
93 | void __iomem *base; | 93 | void __iomem *base; |
94 | const struct hpb_dmae_slave_config *cfg; | 94 | const struct hpb_dmae_slave_config *cfg; |
95 | char dev_id[16]; /* unique name per DMAC of channel */ | 95 | char dev_id[16]; /* unique name per DMAC of channel */ |
96 | dma_addr_t slave_addr; | ||
96 | }; | 97 | }; |
97 | 98 | ||
98 | struct hpb_dmae_device { | 99 | struct hpb_dmae_device { |
@@ -432,7 +433,6 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan, | |||
432 | hpb_chan->xfer_mode = XFER_DOUBLE; | 433 | hpb_chan->xfer_mode = XFER_DOUBLE; |
433 | } else { | 434 | } else { |
434 | dev_err(hpb_chan->shdma_chan.dev, "DCR setting error"); | 435 | dev_err(hpb_chan->shdma_chan.dev, "DCR setting error"); |
435 | shdma_free_irq(&hpb_chan->shdma_chan); | ||
436 | return -EINVAL; | 436 | return -EINVAL; |
437 | } | 437 | } |
438 | 438 | ||
@@ -446,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan, | |||
446 | return 0; | 446 | return 0; |
447 | } | 447 | } |
448 | 448 | ||
449 | 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) | ||
450 | { | 451 | { |
451 | struct hpb_dmae_chan *chan = to_chan(schan); | 452 | struct hpb_dmae_chan *chan = to_chan(schan); |
452 | const struct hpb_dmae_slave_config *sc = | 453 | const struct hpb_dmae_slave_config *sc = |
@@ -457,6 +458,7 @@ static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try) | |||
457 | if (try) | 458 | if (try) |
458 | return 0; | 459 | return 0; |
459 | chan->cfg = sc; | 460 | chan->cfg = sc; |
461 | chan->slave_addr = slave_addr ? : sc->addr; | ||
460 | return hpb_dmae_alloc_chan_resources(chan, sc); | 462 | return hpb_dmae_alloc_chan_resources(chan, sc); |
461 | } | 463 | } |
462 | 464 | ||
@@ -468,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(struct shdma_chan *schan) | |||
468 | { | 470 | { |
469 | struct hpb_dmae_chan *chan = to_chan(schan); | 471 | struct hpb_dmae_chan *chan = to_chan(schan); |
470 | 472 | ||
471 | return chan->cfg->addr; | 473 | return chan->slave_addr; |
472 | } | 474 | } |
473 | 475 | ||
474 | static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i) | 476 | static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i) |
@@ -614,7 +616,6 @@ static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev) | |||
614 | shdma_for_each_chan(schan, &hpbdev->shdma_dev, i) { | 616 | shdma_for_each_chan(schan, &hpbdev->shdma_dev, i) { |
615 | BUG_ON(!schan); | 617 | BUG_ON(!schan); |
616 | 618 | ||
617 | shdma_free_irq(schan); | ||
618 | shdma_chan_remove(schan); | 619 | shdma_chan_remove(schan); |
619 | } | 620 | } |
620 | dma_dev->chancnt = 0; | 621 | dma_dev->chancnt = 0; |