Skip to contentSkip to conversation

ASoC: Intel: fix a compiling issue

PATCH In review Jie Yang 4 participants 7 messages Apr 13, 2015 – Apr 19, 2015

Subsystems (3)
lore
Share & tools
lore

Jie Yang

author
#0 lore raw

PATCH 1/1 ASoC: Intel: fix a compiling issue

Fix the compiling issue that we don't have snd_soc_suspend/resume() when CONFIG_PM_SLEEP is not defined.

---
 sound/soc/intel/haswell/sst-haswell-pcm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/intel/haswell/sst-haswell-pcm.c +4 -1
index 23ae040..f84eb14 100644
@@ -1313,8 +1313,9 @@ static void hsw_pcm_complete(struct device *dev)
 			dev_err(dev, "failed to restore context for PCM %d\n", i);
 	}
 
+#ifdef CONFIG_PM_SLEEP
 	snd_soc_resume(pdata->soc_card->dev);
-
+#endif
 	err = sst_hsw_dsp_runtime_resume(hsw);
 	if (err < 0)
 		return;
@@ -1367,7 +1368,9 @@ static int hsw_pcm_prepare(struct device *dev)
 		sst_hsw_dsp_runtime_sleep(hsw);
 	}
 
+#ifdef CONFIG_PM_SLEEP
 	snd_soc_suspend(pdata->soc_card->dev);
+#endif
 	snd_soc_poweroff(pdata->soc_card->dev);
 
 	pdata->pm_state = HSW_PM_STATE_D3;
Signature · 1 line
1.9.1
#1 lore raw

Hi

Review

Quoted 10 lines · Jie Yang

Fix the compiling issue that we don't have snd_soc_suspend/resume() when CONFIG_PM_SLEEP is not defined.

---
 sound/soc/intel/haswell/sst-haswell-pcm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/sound/soc/intel/haswell/sst-haswell-pcm.c

sound/soc/intel/haswell/sst-haswell-pcm.c static void hsw_pcm_complete(struct device *dev) · line 1313

Quoted 5 lines

index 23ae040..f84eb14 100644

sound/soc/intel/haswell/sst-haswell-pcm.c +0 -0
@@ -1313,8 +1313,9 @@ static void hsw_pcm_complete(struct device *dev)
                        dev_err(dev, "failed to restore context for PCM

%d\n", i);

sound/soc/intel/haswell/sst-haswell-pcm.c static void hsw_pcm_complete(struct device *dev) · line 1318

Quoted 6 lines
sound/soc/intel/haswell/sst-haswell-pcm.c +2 -1
        }
 
+#ifdef CONFIG_PM_SLEEP
        snd_soc_resume(pdata->soc_card->dev);
-
+#endif

I think it's better to include an empy version for this configuration

Michael

Quoted 20 lines
sound/soc/intel/haswell/sst-haswell-pcm.c +2 -1
        err = sst_hsw_dsp_runtime_resume(hsw);
        if (err < 0)
                return;
@@ -1367,7 +1368,9 @@ static int hsw_pcm_prepare(struct device *dev)
                sst_hsw_dsp_runtime_sleep(hsw);
        }
 
+#ifdef CONFIG_PM_SLEEP
        snd_soc_suspend(pdata->soc_card->dev);
+#endif
        snd_soc_poweroff(pdata->soc_card->dev);
 
        pdata->pm_state = HSW_PM_STATE_D3;
--

1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#2 lore raw
Quoted 21 lines · Michael Trimarchi

Hi

Review

Quoted 9 lines · Jie Yang

Fix the compiling issue that we don't have snd_soc_suspend/resume() when CONFIG_PM_SLEEP is not defined.

---
  sound/soc/intel/haswell/sst-haswell-pcm.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/sound/soc/intel/haswell/sst-haswell-pcm.c

sound/soc/intel/haswell/sst-haswell-pcm.c static void hsw_pcm_complete(struct device *dev) · line 1313

Quoted 5 lines

index 23ae040..f84eb14 100644

sound/soc/intel/haswell/sst-haswell-pcm.c +0 -0
@@ -1313,8 +1313,9 @@ static void hsw_pcm_complete(struct device *dev)
                         dev_err(dev, "failed to restore context for PCM

%d\n", i);

Quoted 2 lines
sound/soc/intel/haswell/sst-haswell-pcm.c +0 -0
         }
 
Quoted 7 lines

sound/soc/intel/haswell/sst-haswell-pcm.c static void hsw_pcm_complete(struct device *dev) · line 1318

Quoted 4 lines
sound/soc/intel/haswell/sst-haswell-pcm.c +2 -1
+#ifdef CONFIG_PM_SLEEP
         snd_soc_resume(pdata->soc_card->dev);
-
+#endif

I think it's better to include an empy version for this configuration

Michael

do you mean that adding line such like:

#define snd_soc_resume NULL

we have that in soc-core.c, but only the non-null version is exported.

~Keyon

Quoted 17 lines
Quoted 17 lines
sound/soc/intel/haswell/sst-haswell-pcm.c +2 -1
         err = sst_hsw_dsp_runtime_resume(hsw);
         if (err < 0)
                 return;
@@ -1367,7 +1368,9 @@ static int hsw_pcm_prepare(struct device *dev)
                 sst_hsw_dsp_runtime_sleep(hsw);
         }
 
+#ifdef CONFIG_PM_SLEEP
         snd_soc_suspend(pdata->soc_card->dev);
+#endif
         snd_soc_poweroff(pdata->soc_card->dev);
 
         pdata->pm_state = HSW_PM_STATE_D3;
--

1.9.1

Quoted 9 lines
Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

maintainer
#3 lore raw
In reply to Jie Yang

sound/soc/intel/haswell/sst-haswell-pcm.c static void hsw_pcm_complete(struct device *dev) · line 1318

Quoted 7 lines · Jie Yang

Fix the compiling issue that we don't have snd_soc_suspend/resume() when CONFIG_PM_SLEEP is not defined.

sound/soc/intel/haswell/sst-haswell-pcm.c +2 -1
+#ifdef CONFIG_PM_SLEEP
 	snd_soc_resume(pdata->soc_card->dev);
-
+#endif

Rather than have the ifdefs in the users it seems like it'd be better to fix this by providing static inline stub functions in the headers. That way nothing else will run into the same trouble.

#4 lore raw

Hi

Quoted 5 lines · Mark Brown
Quoted 2 lines · Jie Yang

Fix the compiling issue that we don't have snd_soc_suspend/resume() when CONFIG_PM_SLEEP is not defined.

Quoted 9 lines

sound/soc/intel/haswell/sst-haswell-pcm.c static void hsw_pcm_complete(struct device *dev) · line 1318

Quoted 4 lines
sound/soc/intel/haswell/sst-haswell-pcm.c +2 -1
+#ifdef CONFIG_PM_SLEEP
      snd_soc_resume(pdata->soc_card->dev);
-
+#endif

Rather than have the ifdefs in the users it seems like it'd be better to fix this by providing static inline stub functions in the headers. That way nothing else will run into the same trouble.

This was my "English" suggestion

Thanks

Michael

Quoted 5 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

maintainer
#5 lore raw
Quoted 7 lines · Michael Trimarchi
Quoted 3 lines · Mark Brown

Rather than have the ifdefs in the users it seems like it'd be better to fix this by providing static inline stub functions in the headers. That way nothing else will run into the same trouble.

This was my "English" suggestion

Yeah, I hadn't seen your mail when I wrote the above.

author
#6 lore raw
Quoted 10 lines

-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Sunday, April 19, 2015 1:03 AM
To: Michael Trimarchi
Cc: [email protected]; Jie, Yang; Girdwood, Liam R
Subject: Re: [alsa-devel] [PATCH] ASoC: Intel: fix a compiling issue

Quoted 1 line · Michael Trimarchi

On Apr 18, 2015 8:11 PM, "Mark Brown" <[email protected]> wrote:

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Rather than have the ifdefs in the users it seems like it'd be better to fix this by providing static inline stub functions in the headers. That way nothing else will run into the same trouble.

This was my "English" suggestion

Yeah, I hadn't seen your mail when I wrote the above.

Thank you, Mark and Michael. Will follow it and send another patch soon.

~Keyon