diff mbox series

[v3,5/8] ASoC: qcom: lpass-platform: Replace card->dev with component->dev

Message ID 1594184896-10629-6-git-send-email-rohitkr@codeaurora.org (mailing list archive)
State Superseded
Headers show
Series ASoC: qcom: Add support for SC7180 lpass variant | expand

Commit Message

Rohit Kumar July 8, 2020, 5:08 a.m. UTC
From: Ajit Pandey <ajitp@codeaurora.org>

We are allocating dma memory for component->dev but trying to mmap
such memory for substream->pcm->card->dev. Replace device argument
in mmap with component->dev to fix this.

Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>
---
 sound/soc/qcom/lpass-platform.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Mark Brown July 8, 2020, 4:50 p.m. UTC | #1
On Wed, Jul 08, 2020 at 10:38:13AM +0530, Rohit kumar wrote:
> From: Ajit Pandey <ajitp@codeaurora.org>
> 
> We are allocating dma memory for component->dev but trying to mmap
> such memory for substream->pcm->card->dev. Replace device argument
> in mmap with component->dev to fix this.

This is a bug fix and should've been at the start of the series (or sent
separately) so that it can be applied without the rest of the series.
Rohit Kumar July 9, 2020, 3:46 a.m. UTC | #2
On 7/8/2020 10:20 PM, Mark Brown wrote:
> On Wed, Jul 08, 2020 at 10:38:13AM +0530, Rohit kumar wrote:
>> From: Ajit Pandey <ajitp@codeaurora.org>
>>
>> We are allocating dma memory for component->dev but trying to mmap
>> such memory for substream->pcm->card->dev. Replace device argument
>> in mmap with component->dev to fix this.
> This is a bug fix and should've been at the start of the series (or sent
> separately) so that it can be applied without the rest of the series.

Thanks Mark for the suggestion. I will send it separately.

For other patches in series, I will wait for comments before posting next

patchset.

Thanks,

Rohit
Srinivas Kandagatla July 9, 2020, 9:26 a.m. UTC | #3
On 08/07/2020 06:08, Rohit kumar wrote:
> From: Ajit Pandey <ajitp@codeaurora.org>
> 
> We are allocating dma memory for component->dev but trying to mmap
> such memory for substream->pcm->card->dev. Replace device argument
> in mmap with component->dev to fix this.
> 
> Signed-off-by: Ajit Pandey <ajitp@codeaurora.org>


Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---
>   sound/soc/qcom/lpass-platform.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
> index 445ca193..f9424cc 100644
> --- a/sound/soc/qcom/lpass-platform.c
> +++ b/sound/soc/qcom/lpass-platform.c
> @@ -472,9 +472,8 @@ static int lpass_platform_pcmops_mmap(struct snd_soc_component *component,
>   {
>   	struct snd_pcm_runtime *runtime = substream->runtime;
>   
> -	return dma_mmap_coherent(substream->pcm->card->dev, vma,
> -			runtime->dma_area, runtime->dma_addr,
> -			runtime->dma_bytes);
> +	return dma_mmap_coherent(component->dev, vma, runtime->dma_area,
> +				 runtime->dma_addr, runtime->dma_bytes);
>   }
>   
>   static irqreturn_t lpass_dma_interrupt_handler(
>
diff mbox series

Patch

diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index 445ca193..f9424cc 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -472,9 +472,8 @@  static int lpass_platform_pcmops_mmap(struct snd_soc_component *component,
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
 
-	return dma_mmap_coherent(substream->pcm->card->dev, vma,
-			runtime->dma_area, runtime->dma_addr,
-			runtime->dma_bytes);
+	return dma_mmap_coherent(component->dev, vma, runtime->dma_area,
+				 runtime->dma_addr, runtime->dma_bytes);
 }
 
 static irqreturn_t lpass_dma_interrupt_handler(