Commit 7f0f2048 authored by Joe Perches's avatar Joe Perches Committed by Takashi Iwai

ALSA: Use dma_zalloc_coherent

Use the zeroing function instead of dma_alloc_coherent & memset(,0,)
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 74b0c2d7
...@@ -47,15 +47,11 @@ static int alloc_dbdma_descriptor_ring(struct i2sbus_dev *i2sdev, ...@@ -47,15 +47,11 @@ static int alloc_dbdma_descriptor_ring(struct i2sbus_dev *i2sdev,
/* We use the PCI APIs for now until the generic one gets fixed /* We use the PCI APIs for now until the generic one gets fixed
* enough or until we get some macio-specific versions * enough or until we get some macio-specific versions
*/ */
r->space = dma_alloc_coherent( r->space = dma_zalloc_coherent(&macio_get_pci_dev(i2sdev->macio)->dev,
&macio_get_pci_dev(i2sdev->macio)->dev, r->size, &r->bus_addr, GFP_KERNEL);
r->size, if (!r->space)
&r->bus_addr, return -ENOMEM;
GFP_KERNEL);
if (!r->space) return -ENOMEM;
memset(r->space, 0, r->size);
r->cmds = (void*)DBDMA_ALIGN(r->space); r->cmds = (void*)DBDMA_ALIGN(r->space);
r->bus_cmd_start = r->bus_addr + r->bus_cmd_start = r->bus_addr +
(dma_addr_t)((char*)r->cmds - (char*)r->space); (dma_addr_t)((char*)r->cmds - (char*)r->space);
......
...@@ -2534,12 +2534,10 @@ static int snd_dbri_create(struct snd_card *card, ...@@ -2534,12 +2534,10 @@ static int snd_dbri_create(struct snd_card *card,
dbri->op = op; dbri->op = op;
dbri->irq = irq; dbri->irq = irq;
dbri->dma = dma_alloc_coherent(&op->dev, dbri->dma = dma_zalloc_coherent(&op->dev, sizeof(struct dbri_dma),
sizeof(struct dbri_dma), &dbri->dma_dvma, GFP_ATOMIC);
&dbri->dma_dvma, GFP_ATOMIC);
if (!dbri->dma) if (!dbri->dma)
return -ENOMEM; return -ENOMEM;
memset((void *)dbri->dma, 0, sizeof(struct dbri_dma));
dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n", dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n",
dbri->dma, dbri->dma_dvma); dbri->dma, dbri->dma_dvma);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment