Re: [alsa-devel] Patch to /sound/soc/pxa/pxa2xx_pcm.c, WHO IS INTERESTED?
On Thu, Dec 18, 2008 at 10:34:53AM -0800, sware wrote:
Patch is to 2.6.27.9 (yesterday), notice .10 is up today, patch should still apply.
Thanks for your patch. Unfortunately all this code has been moved about a lot in the latest code in order to share the code with the non-ASoC AC97 driver so your patch won't apply - see the topic/asoc branch of
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
for the latest code. Could you rebase your work against that, please? Also, please include a Signed-off-by line for patch submissions - for details see Documentation/SubmittingPatches
diff -uprN -X linux-2.6.27.9.orig/Documentation/dontdiff linux-2.6.27.9.orig/sound/soc/pxa/pxa2xx-pcm.c linux-2.6.27.9.snd_modified/sound/soc/pxa/pxa2xx-pcm.c --- linux-2.6.27.9.orig/sound/soc/pxa/pxa2xx-pcm.c 2008-12-13 15:56:16.000000000 -0800 +++ linux-2.6.27.9.snd_modified/sound/soc/pxa/pxa2xx-pcm.c 2008-12-17 14:09:02.000000000 -0800 @@ -137,13 +137,18 @@ static int pxa2xx_pcm_hw_free(struct snd { struct pxa2xx_runtime_data *prtd = substream->runtime->private_data;
- if (prtd && prtd->params)
- if (!prtd)
return 0;
- if (!prtd->params)
return 0;
prtd should always be there - the code should at least complain loudly if it's NULL. params might potentially be hit, though.
*prtd->params->drcmr = 0;
- if (prtd->dma_ch) {
- if (prtd->dma_ch >= 0) { snd_pcm_set_runtime_buffer(substream, NULL); pxa_free_dma(prtd->dma_ch);
prtd->dma_ch = 0;
prtd->dma_ch = -1; /* invalid channel */
}prtd->params = NULL;
This bit is good.
@@ -266,6 +271,8 @@ static int pxa2xx_pcm_close(struct snd_p dma_free_writecombine(substream->pcm->card->dev, PAGE_SIZE, prtd->dma_desc_array, prtd->dma_desc_array_phys); kfree(prtd);
- runtime->private_data = NULL;
- return 0;
}
As is this.
At Fri, 19 Dec 2008 11:57:38 +0000, Mark Brown wrote:
@@ -266,6 +271,8 @@ static int pxa2xx_pcm_close(struct snd_p dma_free_writecombine(substream->pcm->card->dev, PAGE_SIZE, prtd->dma_desc_array, prtd->dma_desc_array_phys); kfree(prtd);
- runtime->private_data = NULL;
- return 0;
}
This looks superfluous. The runtime instance will be anyway freed soon after the close callback.
Just a subtle thing, though.
Takashi
On Fri, Dec 19, 2008 at 01:03:59PM +0100, Takashi Iwai wrote:
Mark Brown wrote:
kfree(prtd);
- runtime->private_data = NULL;
This looks superfluous. The runtime instance will be anyway freed soon after the close callback.
Even if it wasn't the driver will overwrite it on open(). OTOH it doesn't do any harm either.
participants (2)
-
Mark Brown
-
Takashi Iwai