diff options
author | Joe Perches <joe@perches.com> | 2014-06-15 16:37:55 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-06-16 05:39:45 -0400 |
commit | 7f0f20486f4d3da7abaf0099738708881196aa2f (patch) | |
tree | 5f89373086e652a603cefda67d06aeafc346dcf8 | |
parent | 74b0c2d75fb4cc89173944e6d8f9eb47aca0c343 (diff) |
ALSA: Use dma_zalloc_coherent
Use the zeroing function instead of dma_alloc_coherent & memset(,0,)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/aoa/soundbus/i2sbus/core.c | 12 | ||||
-rw-r--r-- | sound/sparc/dbri.c | 6 |
2 files changed, 6 insertions, 12 deletions
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index 467836057ee5..a80d5ea87ccd 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c | |||
@@ -47,15 +47,11 @@ static int alloc_dbdma_descriptor_ring(struct i2sbus_dev *i2sdev, | |||
47 | /* We use the PCI APIs for now until the generic one gets fixed | 47 | /* We use the PCI APIs for now until the generic one gets fixed |
48 | * enough or until we get some macio-specific versions | 48 | * enough or until we get some macio-specific versions |
49 | */ | 49 | */ |
50 | r->space = dma_alloc_coherent( | 50 | r->space = dma_zalloc_coherent(&macio_get_pci_dev(i2sdev->macio)->dev, |
51 | &macio_get_pci_dev(i2sdev->macio)->dev, | 51 | r->size, &r->bus_addr, GFP_KERNEL); |
52 | r->size, | 52 | if (!r->space) |
53 | &r->bus_addr, | 53 | return -ENOMEM; |
54 | GFP_KERNEL); | ||
55 | 54 | ||
56 | if (!r->space) return -ENOMEM; | ||
57 | |||
58 | memset(r->space, 0, r->size); | ||
59 | r->cmds = (void*)DBDMA_ALIGN(r->space); | 55 | r->cmds = (void*)DBDMA_ALIGN(r->space); |
60 | r->bus_cmd_start = r->bus_addr + | 56 | r->bus_cmd_start = r->bus_addr + |
61 | (dma_addr_t)((char*)r->cmds - (char*)r->space); | 57 | (dma_addr_t)((char*)r->cmds - (char*)r->space); |
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index be1b1aa96b7e..b2c3d0d5dca3 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c | |||
@@ -2534,12 +2534,10 @@ static int snd_dbri_create(struct snd_card *card, | |||
2534 | dbri->op = op; | 2534 | dbri->op = op; |
2535 | dbri->irq = irq; | 2535 | dbri->irq = irq; |
2536 | 2536 | ||
2537 | dbri->dma = dma_alloc_coherent(&op->dev, | 2537 | dbri->dma = dma_zalloc_coherent(&op->dev, sizeof(struct dbri_dma), |
2538 | sizeof(struct dbri_dma), | 2538 | &dbri->dma_dvma, GFP_ATOMIC); |
2539 | &dbri->dma_dvma, GFP_ATOMIC); | ||
2540 | if (!dbri->dma) | 2539 | if (!dbri->dma) |
2541 | return -ENOMEM; | 2540 | return -ENOMEM; |
2542 | memset((void *)dbri->dma, 0, sizeof(struct dbri_dma)); | ||
2543 | 2541 | ||
2544 | dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n", | 2542 | dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n", |
2545 | dbri->dma, dbri->dma_dvma); | 2543 | dbri->dma, dbri->dma_dvma); |