linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] ASoC: Intel: bytcht_es8316: Set correct platform drvdata in snd_byt_cht_es8316_mc_probe()
@ 2019-01-09  8:36 Wei Yongjun
  2019-01-09  9:29 ` Dan Carpenter
  2019-01-10  1:43 ` [PATCH -next v2] ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove() Wei Yongjun
  0 siblings, 2 replies; 8+ messages in thread
From: Wei Yongjun @ 2019-01-09  8:36 UTC (permalink / raw)
  To: Pierre-Louis Bossart, Liam Girdwood, Jie Yang, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Hans de Goede, Andy Shevchenko,
	Vinod Koul
  Cc: Wei Yongjun, alsa-devel, linux-kernel, kernel-janitors

The snd_byt_cht_es8316_mc_remove() use the platform drvdata as a type
of 'struct byt_cht_es8316_private', but snd_byt_cht_es8316_mc_probe() set
it to 'struct snd_soc_card', fix to pass correct platform drvdata to
platform_set_drvdata().

Fixes: 0d3e91da0750 ("ASoC: Intel: bytcht_es8316: Add external speaker mux support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 sound/soc/intel/boards/bytcht_es8316.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
index cdf2061..42111d8 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -538,7 +538,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 		dev_err(dev, "snd_soc_register_card failed: %d\n", ret);
 		return ret;
 	}
-	platform_set_drvdata(pdev, &byt_cht_es8316_card);
+	platform_set_drvdata(pdev, priv);
 	return 0;
 }




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] ASoC: Intel: bytcht_es8316: Set correct platform drvdata in snd_byt_cht_es8316_mc_probe()
  2019-01-09  8:36 [PATCH -next] ASoC: Intel: bytcht_es8316: Set correct platform drvdata in snd_byt_cht_es8316_mc_probe() Wei Yongjun
@ 2019-01-09  9:29 ` Dan Carpenter
  2019-01-09  9:33   ` Hans de Goede
  2019-01-10  1:43 ` [PATCH -next v2] ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove() Wei Yongjun
  1 sibling, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2019-01-09  9:29 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Pierre-Louis Bossart, Liam Girdwood, Jie Yang, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Hans de Goede, Andy Shevchenko,
	Vinod Koul, alsa-devel, linux-kernel, kernel-janitors

I think the correct fix is actually this (untested):

diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
index cdf2061e7613..fa9c4cf97686 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -544,7 +544,8 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 
 static int snd_byt_cht_es8316_mc_remove(struct platform_device *pdev)
 {
-	struct byt_cht_es8316_private *priv = platform_get_drvdata(pdev);
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+	struct byt_cht_es8316_private *priv = snd_soc_card_get_drvdata(card);
 
 	gpiod_put(priv->speaker_en_gpio);
 	return 0;

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] ASoC: Intel: bytcht_es8316: Set correct platform drvdata in snd_byt_cht_es8316_mc_probe()
  2019-01-09  9:29 ` Dan Carpenter
@ 2019-01-09  9:33   ` Hans de Goede
  2019-01-09  9:40     ` Dan Carpenter
  0 siblings, 1 reply; 8+ messages in thread
From: Hans de Goede @ 2019-01-09  9:33 UTC (permalink / raw)
  To: Dan Carpenter, Wei Yongjun
  Cc: Pierre-Louis Bossart, Liam Girdwood, Jie Yang, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Andy Shevchenko, Vinod Koul,
	alsa-devel, linux-kernel, kernel-janitors

Hi,

On 09-01-19 10:29, Dan Carpenter wrote:
> I think the correct fix is actually this (untested):

Right, I'm pretty sure the soc framework depends on dev_get_drvdata
returning the snd_soc_card and I forgot about this when adding
the remove function.

Wei Yongjun, thank you for catching this.

Dan, thank you for the correct version of the patch :)

Dan, can you do an official submission of the correct version of the
patch, with a Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
or shall I submit your version upstream ?

Regards,

Hans


> 
> diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
> index cdf2061e7613..fa9c4cf97686 100644
> --- a/sound/soc/intel/boards/bytcht_es8316.c
> +++ b/sound/soc/intel/boards/bytcht_es8316.c
> @@ -544,7 +544,8 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
>   
>   static int snd_byt_cht_es8316_mc_remove(struct platform_device *pdev)
>   {
> -	struct byt_cht_es8316_private *priv = platform_get_drvdata(pdev);
> +	struct snd_soc_card *card = platform_get_drvdata(pdev);
> +	struct byt_cht_es8316_private *priv = snd_soc_card_get_drvdata(card);
>   
>   	gpiod_put(priv->speaker_en_gpio);
>   	return 0;
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] ASoC: Intel: bytcht_es8316: Set correct platform drvdata in snd_byt_cht_es8316_mc_probe()
  2019-01-09  9:33   ` Hans de Goede
@ 2019-01-09  9:40     ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2019-01-09  9:40 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Wei Yongjun, Pierre-Louis Bossart, Liam Girdwood, Jie Yang,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Andy Shevchenko,
	Vinod Koul, alsa-devel, linux-kernel, kernel-janitors

On Wed, Jan 09, 2019 at 10:33:38AM +0100, Hans de Goede wrote:
> Hi,
> 
> On 09-01-19 10:29, Dan Carpenter wrote:
> > I think the correct fix is actually this (untested):
> 
> Right, I'm pretty sure the soc framework depends on dev_get_drvdata
> returning the snd_soc_card and I forgot about this when adding
> the remove function.
> 
> Wei Yongjun, thank you for catching this.
> 
> Dan, thank you for the correct version of the patch :)
> 
> Dan, can you do an official submission of the correct version of the
> patch, with a Reported-by: Wei Yongjun <weiyongjun1@huawei.com>
> or shall I submit your version upstream ?

Wei can resend and get authorship credit.  I only wrote the patch by
accident because it was easier than explaining.  (Or if you really don't
want to, Wei, then message me and I will do it).

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH -next v2] ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove()
  2019-01-09  8:36 [PATCH -next] ASoC: Intel: bytcht_es8316: Set correct platform drvdata in snd_byt_cht_es8316_mc_probe() Wei Yongjun
  2019-01-09  9:29 ` Dan Carpenter
@ 2019-01-10  1:43 ` Wei Yongjun
  2019-01-10  2:50   ` [alsa-devel] " Pierre-Louis Bossart
                     ` (2 more replies)
  1 sibling, 3 replies; 8+ messages in thread
From: Wei Yongjun @ 2019-01-10  1:43 UTC (permalink / raw)
  To: Pierre-Louis Bossart, Liam Girdwood, Jie Yang, Mark Brown,
	Hans de Goede, Andy Shevchenko, Vinod Koul, Dan Carpenter
  Cc: Wei Yongjun, alsa-devel, linux-kernel, kernel-janitors

The snd_byt_cht_es8316_mc_remove() use the platform drvdata as a type
of 'struct byt_cht_es8316_private', but snd_byt_cht_es8316_mc_probe()
set it to 'struct snd_soc_card', as suggested by Dan Carpenter, fix
the usage in snd_byt_cht_es8316_mc_remove().

Fixes: 0d3e91da0750 ("ASoC: Intel: bytcht_es8316: Add external speaker mux support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 -> v2: fix snd_byt_cht_es8316_mc_remove() instead, suggested by Dan.
---
 sound/soc/intel/boards/bytcht_es8316.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
index cdf2061..fa9c4cf 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -544,7 +544,8 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 
 static int snd_byt_cht_es8316_mc_remove(struct platform_device *pdev)
 {
-	struct byt_cht_es8316_private *priv = platform_get_drvdata(pdev);
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+	struct byt_cht_es8316_private *priv = snd_soc_card_get_drvdata(card);
 
 	gpiod_put(priv->speaker_en_gpio);
 	return 0;




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [alsa-devel] [PATCH -next v2] ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove()
  2019-01-10  1:43 ` [PATCH -next v2] ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove() Wei Yongjun
@ 2019-01-10  2:50   ` Pierre-Louis Bossart
  2019-01-10  7:20   ` Hans de Goede
  2019-01-10 11:54   ` Applied "ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove()" to the asoc tree Mark Brown
  2 siblings, 0 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2019-01-10  2:50 UTC (permalink / raw)
  To: Wei Yongjun, Liam Girdwood, Jie Yang, Mark Brown, Hans de Goede,
	Andy Shevchenko, Vinod Koul, Dan Carpenter
  Cc: kernel-janitors, alsa-devel, linux-kernel


On 1/9/19 7:43 PM, Wei Yongjun wrote:
> The snd_byt_cht_es8316_mc_remove() use the platform drvdata as a type
> of 'struct byt_cht_es8316_private', but snd_byt_cht_es8316_mc_probe()
> set it to 'struct snd_soc_card', as suggested by Dan Carpenter, fix
> the usage in snd_byt_cht_es8316_mc_remove().
>
> Fixes: 0d3e91da0750 ("ASoC: Intel: bytcht_es8316: Add external speaker mux support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> ---
> v1 -> v2: fix snd_byt_cht_es8316_mc_remove() instead, suggested by Dan.
> ---
>   sound/soc/intel/boards/bytcht_es8316.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
> index cdf2061..fa9c4cf 100644
> --- a/sound/soc/intel/boards/bytcht_es8316.c
> +++ b/sound/soc/intel/boards/bytcht_es8316.c
> @@ -544,7 +544,8 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
>   
>   static int snd_byt_cht_es8316_mc_remove(struct platform_device *pdev)
>   {
> -	struct byt_cht_es8316_private *priv = platform_get_drvdata(pdev);
> +	struct snd_soc_card *card = platform_get_drvdata(pdev);
> +	struct byt_cht_es8316_private *priv = snd_soc_card_get_drvdata(card);
>   
>   	gpiod_put(priv->speaker_en_gpio);
>   	return 0;
>
>
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next v2] ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove()
  2019-01-10  1:43 ` [PATCH -next v2] ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove() Wei Yongjun
  2019-01-10  2:50   ` [alsa-devel] " Pierre-Louis Bossart
@ 2019-01-10  7:20   ` Hans de Goede
  2019-01-10 11:54   ` Applied "ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove()" to the asoc tree Mark Brown
  2 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2019-01-10  7:20 UTC (permalink / raw)
  To: Wei Yongjun, Pierre-Louis Bossart, Liam Girdwood, Jie Yang,
	Mark Brown, Andy Shevchenko, Vinod Koul, Dan Carpenter
  Cc: alsa-devel, linux-kernel, kernel-janitors

Hi,

On 10-01-19 02:43, Wei Yongjun wrote:
> The snd_byt_cht_es8316_mc_remove() use the platform drvdata as a type
> of 'struct byt_cht_es8316_private', but snd_byt_cht_es8316_mc_probe()
> set it to 'struct snd_soc_card', as suggested by Dan Carpenter, fix
> the usage in snd_byt_cht_es8316_mc_remove().
> 
> Fixes: 0d3e91da0750 ("ASoC: Intel: bytcht_es8316: Add external speaker mux support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Thank you for catching this, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
> v1 -> v2: fix snd_byt_cht_es8316_mc_remove() instead, suggested by Dan.
> ---
>   sound/soc/intel/boards/bytcht_es8316.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
> index cdf2061..fa9c4cf 100644
> --- a/sound/soc/intel/boards/bytcht_es8316.c
> +++ b/sound/soc/intel/boards/bytcht_es8316.c
> @@ -544,7 +544,8 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
>   
>   static int snd_byt_cht_es8316_mc_remove(struct platform_device *pdev)
>   {
> -	struct byt_cht_es8316_private *priv = platform_get_drvdata(pdev);
> +	struct snd_soc_card *card = platform_get_drvdata(pdev);
> +	struct byt_cht_es8316_private *priv = snd_soc_card_get_drvdata(card);
>   
>   	gpiod_put(priv->speaker_en_gpio);
>   	return 0;
> 
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Applied "ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove()" to the asoc tree
  2019-01-10  1:43 ` [PATCH -next v2] ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove() Wei Yongjun
  2019-01-10  2:50   ` [alsa-devel] " Pierre-Louis Bossart
  2019-01-10  7:20   ` Hans de Goede
@ 2019-01-10 11:54   ` Mark Brown
  2 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2019-01-10 11:54 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Pierre-Louis Bossart, Mark Brown, Pierre-Louis Bossart,
	Liam Girdwood, Jie Yang, Mark Brown, Hans de Goede,
	Andy Shevchenko, Vinod Koul, Dan Carpenter, kernel-janitors,
	alsa-devel, linux-kernel, alsa-devel

The patch

   ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From f833fe2056b3a6d69598ef029cede6e77dcc1b14 Mon Sep 17 00:00:00 2001
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Thu, 10 Jan 2019 01:43:09 +0000
Subject: [PATCH] ASoC: Intel: bytcht_es8316: use correct drvdata in
 snd_byt_cht_es8316_mc_remove()

The snd_byt_cht_es8316_mc_remove() use the platform drvdata as a type
of 'struct byt_cht_es8316_private', but snd_byt_cht_es8316_mc_probe()
set it to 'struct snd_soc_card', as suggested by Dan Carpenter, fix
the usage in snd_byt_cht_es8316_mc_remove().

Fixes: 0d3e91da0750 ("ASoC: Intel: bytcht_es8316: Add external speaker mux support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/bytcht_es8316.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
index cdf2061e7613..fa9c4cf97686 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -544,7 +544,8 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 
 static int snd_byt_cht_es8316_mc_remove(struct platform_device *pdev)
 {
-	struct byt_cht_es8316_private *priv = platform_get_drvdata(pdev);
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+	struct byt_cht_es8316_private *priv = snd_soc_card_get_drvdata(card);
 
 	gpiod_put(priv->speaker_en_gpio);
 	return 0;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-01-10 11:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09  8:36 [PATCH -next] ASoC: Intel: bytcht_es8316: Set correct platform drvdata in snd_byt_cht_es8316_mc_probe() Wei Yongjun
2019-01-09  9:29 ` Dan Carpenter
2019-01-09  9:33   ` Hans de Goede
2019-01-09  9:40     ` Dan Carpenter
2019-01-10  1:43 ` [PATCH -next v2] ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove() Wei Yongjun
2019-01-10  2:50   ` [alsa-devel] " Pierre-Louis Bossart
2019-01-10  7:20   ` Hans de Goede
2019-01-10 11:54   ` Applied "ASoC: Intel: bytcht_es8316: use correct drvdata in snd_byt_cht_es8316_mc_remove()" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).