All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: amd: remove unused header file inclusion
@ 2022-07-07 13:26 ` Vijendar Mukunda
  0 siblings, 0 replies; 14+ messages in thread
From: Vijendar Mukunda @ 2022-07-07 13:26 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: amadeuszx.slawinski, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	zhuning, Vijendar Mukunda, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, open list

Removed unused header file inclusion from Jadeite platform machine
driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 sound/soc/amd/acp-es8336.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
index eec3d57092fa..8ce26c9b3ead 100644
--- a/sound/soc/amd/acp-es8336.c
+++ b/sound/soc/amd/acp-es8336.c
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 #include <linux/acpi.h>
 
-#include "../codecs/es8316.h"
 #include "acp.h"
 
 #define DUAL_CHANNEL	2
-- 
2.25.1


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

* [PATCH 1/3] ASoC: amd: remove unused header file inclusion
@ 2022-07-07 13:26 ` Vijendar Mukunda
  0 siblings, 0 replies; 14+ messages in thread
From: Vijendar Mukunda @ 2022-07-07 13:26 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: Sunil-kumar.Dommati, open list, Basavaraj.Hiregoudar,
	amadeuszx.slawinski, Liam Girdwood, Vijendar Mukunda, zhuning,
	Takashi Iwai

Removed unused header file inclusion from Jadeite platform machine
driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 sound/soc/amd/acp-es8336.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
index eec3d57092fa..8ce26c9b3ead 100644
--- a/sound/soc/amd/acp-es8336.c
+++ b/sound/soc/amd/acp-es8336.c
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 #include <linux/acpi.h>
 
-#include "../codecs/es8316.h"
 #include "acp.h"
 
 #define DUAL_CHANNEL	2
-- 
2.25.1


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

* [PATCH 2/3] ASoC: amd: drop machine driver remove function
  2022-07-07 13:26 ` Vijendar Mukunda
@ 2022-07-07 13:26   ` Vijendar Mukunda
  -1 siblings, 0 replies; 14+ messages in thread
From: Vijendar Mukunda @ 2022-07-07 13:26 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: amadeuszx.slawinski, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	zhuning, Vijendar Mukunda, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, open list

Drop machine driver remove() function.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 sound/soc/amd/acp-es8336.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
index 8ce26c9b3ead..90f4e5809c72 100644
--- a/sound/soc/amd/acp-es8336.c
+++ b/sound/soc/amd/acp-es8336.c
@@ -293,11 +293,6 @@ static int st_es8336_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int st_es8336_remove(struct platform_device *pdev)
-{
-	return 0;
-}
-
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id st_audio_acpi_match[] = {
 	{"AMDI8336", 0},
@@ -313,7 +308,6 @@ static struct platform_driver st_mach_driver = {
 		.pm = &snd_soc_pm_ops,
 	},
 	.probe = st_es8336_probe,
-	.remove = st_es8336_remove,
 };
 
 module_platform_driver(st_mach_driver);
-- 
2.25.1


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

* [PATCH 2/3] ASoC: amd: drop machine driver remove function
@ 2022-07-07 13:26   ` Vijendar Mukunda
  0 siblings, 0 replies; 14+ messages in thread
From: Vijendar Mukunda @ 2022-07-07 13:26 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: Sunil-kumar.Dommati, open list, Basavaraj.Hiregoudar,
	amadeuszx.slawinski, Liam Girdwood, Vijendar Mukunda, zhuning,
	Takashi Iwai

Drop machine driver remove() function.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
---
 sound/soc/amd/acp-es8336.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
index 8ce26c9b3ead..90f4e5809c72 100644
--- a/sound/soc/amd/acp-es8336.c
+++ b/sound/soc/amd/acp-es8336.c
@@ -293,11 +293,6 @@ static int st_es8336_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int st_es8336_remove(struct platform_device *pdev)
-{
-	return 0;
-}
-
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id st_audio_acpi_match[] = {
 	{"AMDI8336", 0},
@@ -313,7 +308,6 @@ static struct platform_driver st_mach_driver = {
 		.pm = &snd_soc_pm_ops,
 	},
 	.probe = st_es8336_probe,
-	.remove = st_es8336_remove,
 };
 
 module_platform_driver(st_mach_driver);
-- 
2.25.1


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

* [PATCH 3/3] ASoC: amd: fix for variable set but not used warning
  2022-07-07 13:26 ` Vijendar Mukunda
@ 2022-07-07 13:26   ` Vijendar Mukunda
  -1 siblings, 0 replies; 14+ messages in thread
From: Vijendar Mukunda @ 2022-07-07 13:26 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: amadeuszx.slawinski, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	zhuning, Vijendar Mukunda, kernel test robot, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, open list

Fix below kernel warning.
>>> sound/soc/amd/acp-es8336.c:200:13: warning: variable 'ret' set but
>>> not used [-Wunused-but-set-variable]

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
---
 sound/soc/amd/acp-es8336.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
index 90f4e5809c72..e1479ae684e9 100644
--- a/sound/soc/amd/acp-es8336.c
+++ b/sound/soc/amd/acp-es8336.c
@@ -206,6 +206,8 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
 		dev_err(card->dev, "can not find codec dev\n");
 
 	ret = devm_acpi_dev_add_driver_gpios(codec_dev, acpi_es8336_gpios);
+	if (ret)
+		dev_warn(card->dev, "Failed to add driver gpios\n");
 
 	gpio_pa = gpiod_get_optional(codec_dev, "pa-enable", GPIOD_OUT_LOW);
 	if (IS_ERR(gpio_pa)) {
@@ -213,6 +215,7 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
 				    "could not get pa-enable GPIO\n");
 		gpiod_put(gpio_pa);
 		put_device(codec_dev);
+		return ret;
 	}
 	return 0;
 }
-- 
2.25.1


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

* [PATCH 3/3] ASoC: amd: fix for variable set but not used warning
@ 2022-07-07 13:26   ` Vijendar Mukunda
  0 siblings, 0 replies; 14+ messages in thread
From: Vijendar Mukunda @ 2022-07-07 13:26 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: Sunil-kumar.Dommati, kernel test robot, open list,
	Basavaraj.Hiregoudar, amadeuszx.slawinski, Liam Girdwood,
	Vijendar Mukunda, zhuning, Takashi Iwai

Fix below kernel warning.
>>> sound/soc/amd/acp-es8336.c:200:13: warning: variable 'ret' set but
>>> not used [-Wunused-but-set-variable]

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
---
 sound/soc/amd/acp-es8336.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
index 90f4e5809c72..e1479ae684e9 100644
--- a/sound/soc/amd/acp-es8336.c
+++ b/sound/soc/amd/acp-es8336.c
@@ -206,6 +206,8 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
 		dev_err(card->dev, "can not find codec dev\n");
 
 	ret = devm_acpi_dev_add_driver_gpios(codec_dev, acpi_es8336_gpios);
+	if (ret)
+		dev_warn(card->dev, "Failed to add driver gpios\n");
 
 	gpio_pa = gpiod_get_optional(codec_dev, "pa-enable", GPIOD_OUT_LOW);
 	if (IS_ERR(gpio_pa)) {
@@ -213,6 +215,7 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
 				    "could not get pa-enable GPIO\n");
 		gpiod_put(gpio_pa);
 		put_device(codec_dev);
+		return ret;
 	}
 	return 0;
 }
-- 
2.25.1


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

* Re: [PATCH 1/3] ASoC: amd: remove unused header file inclusion
  2022-07-07 13:26 ` Vijendar Mukunda
@ 2022-07-08 20:47   ` Mark Brown
  -1 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2022-07-08 20:47 UTC (permalink / raw)
  To: alsa-devel, Vijendar.Mukunda
  Cc: zhuning, lgirdwood, linux-kernel, amadeuszx.slawinski, perex,
	tiwai, Basavaraj.Hiregoudar, Sunil-kumar.Dommati

On Thu, 7 Jul 2022 18:56:08 +0530, Vijendar Mukunda wrote:
> Removed unused header file inclusion from Jadeite platform machine
> driver.
> 
> 

Applied to

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

Thanks!

[1/3] ASoC: amd: remove unused header file inclusion
      commit: d7e5d8d24c1179b36a3cb40b3f785e23a8992acd
[2/3] ASoC: amd: drop machine driver remove function
      commit: 8d9cd3ead42a6d3bac131c4331acfa5244674fbb
[3/3] ASoC: amd: fix for variable set but not used warning
      commit: 0de876c125188e502d2899de4bcba8d4a6b1f98c

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

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

* Re: [PATCH 1/3] ASoC: amd: remove unused header file inclusion
@ 2022-07-08 20:47   ` Mark Brown
  0 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2022-07-08 20:47 UTC (permalink / raw)
  To: alsa-devel, Vijendar.Mukunda
  Cc: Sunil-kumar.Dommati, lgirdwood, linux-kernel,
	Basavaraj.Hiregoudar, tiwai, amadeuszx.slawinski, zhuning

On Thu, 7 Jul 2022 18:56:08 +0530, Vijendar Mukunda wrote:
> Removed unused header file inclusion from Jadeite platform machine
> driver.
> 
> 

Applied to

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

Thanks!

[1/3] ASoC: amd: remove unused header file inclusion
      commit: d7e5d8d24c1179b36a3cb40b3f785e23a8992acd
[2/3] ASoC: amd: drop machine driver remove function
      commit: 8d9cd3ead42a6d3bac131c4331acfa5244674fbb
[3/3] ASoC: amd: fix for variable set but not used warning
      commit: 0de876c125188e502d2899de4bcba8d4a6b1f98c

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

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

* Re: [PATCH 3/3] ASoC: amd: fix for variable set but not used warning
  2022-07-07 13:26   ` Vijendar Mukunda
@ 2022-07-09  7:33     ` Christophe JAILLET
  -1 siblings, 0 replies; 14+ messages in thread
From: Christophe JAILLET @ 2022-07-09  7:33 UTC (permalink / raw)
  To: Vijendar Mukunda, broonie, alsa-devel
  Cc: amadeuszx.slawinski, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	zhuning, kernel test robot, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, open list

Le 07/07/2022 à 15:26, Vijendar Mukunda a écrit :
> Fix below kernel warning.
>>>> sound/soc/amd/acp-es8336.c:200:13: warning: variable 'ret' set but
>>>> not used [-Wunused-but-set-variable]
> 

Hi,
this patch, looks odd to me.


> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> Reported-by: kernel test robot <lkp@intel.com>
> ---
>   sound/soc/amd/acp-es8336.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
> index 90f4e5809c72..e1479ae684e9 100644
> --- a/sound/soc/amd/acp-es8336.c
> +++ b/sound/soc/amd/acp-es8336.c
> @@ -206,6 +206,8 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
>   		dev_err(card->dev, "can not find codec dev\n");

The next devm_acpi_dev_add_driver_gpios() will fail, should we return 
immediately?

>   
>   	ret = devm_acpi_dev_add_driver_gpios(codec_dev, acpi_es8336_gpios);
> +	if (ret)
> +		dev_warn(card->dev, "Failed to add driver gpios\n");

Should we return immediately?
>   
>   	gpio_pa = gpiod_get_optional(codec_dev, "pa-enable", GPIOD_OUT_LOW);
>   	if (IS_ERR(gpio_pa)) {
> @@ -213,6 +215,7 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
>   				    "could not get pa-enable GPIO\n");
>   		gpiod_put(gpio_pa);
>   		put_device(codec_dev);
> +		return ret;

Here, we return 'ret' which is what is returned by 
devm_acpi_dev_add_driver_gpios(). So there doesn't seem to be a link 
with this block which checks for gpiod_get_optional() errors.

Moreover, returning an error for something that is optional 
(gpiod_get_optional()) looks strange.

Finally, should an error be returned, maybe PTR_ERR(gpio_pa) would be 
better here.


Just my 2c.

CJ

>   	}
>   	return 0;
>   }


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

* Re: [PATCH 3/3] ASoC: amd: fix for variable set but not used warning
@ 2022-07-09  7:33     ` Christophe JAILLET
  0 siblings, 0 replies; 14+ messages in thread
From: Christophe JAILLET @ 2022-07-09  7:33 UTC (permalink / raw)
  To: Vijendar Mukunda, broonie, alsa-devel
  Cc: Sunil-kumar.Dommati, kernel test robot, open list,
	Basavaraj.Hiregoudar, Takashi Iwai, Liam Girdwood,
	amadeuszx.slawinski, zhuning

Le 07/07/2022 à 15:26, Vijendar Mukunda a écrit :
> Fix below kernel warning.
>>>> sound/soc/amd/acp-es8336.c:200:13: warning: variable 'ret' set but
>>>> not used [-Wunused-but-set-variable]
> 

Hi,
this patch, looks odd to me.


> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> Reported-by: kernel test robot <lkp@intel.com>
> ---
>   sound/soc/amd/acp-es8336.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
> index 90f4e5809c72..e1479ae684e9 100644
> --- a/sound/soc/amd/acp-es8336.c
> +++ b/sound/soc/amd/acp-es8336.c
> @@ -206,6 +206,8 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
>   		dev_err(card->dev, "can not find codec dev\n");

The next devm_acpi_dev_add_driver_gpios() will fail, should we return 
immediately?

>   
>   	ret = devm_acpi_dev_add_driver_gpios(codec_dev, acpi_es8336_gpios);
> +	if (ret)
> +		dev_warn(card->dev, "Failed to add driver gpios\n");

Should we return immediately?
>   
>   	gpio_pa = gpiod_get_optional(codec_dev, "pa-enable", GPIOD_OUT_LOW);
>   	if (IS_ERR(gpio_pa)) {
> @@ -213,6 +215,7 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
>   				    "could not get pa-enable GPIO\n");
>   		gpiod_put(gpio_pa);
>   		put_device(codec_dev);
> +		return ret;

Here, we return 'ret' which is what is returned by 
devm_acpi_dev_add_driver_gpios(). So there doesn't seem to be a link 
with this block which checks for gpiod_get_optional() errors.

Moreover, returning an error for something that is optional 
(gpiod_get_optional()) looks strange.

Finally, should an error be returned, maybe PTR_ERR(gpio_pa) would be 
better here.


Just my 2c.

CJ

>   	}
>   	return 0;
>   }


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

* Re: [PATCH 3/3] ASoC: amd: fix for variable set but not used warning
  2022-07-09  7:33     ` Christophe JAILLET
@ 2022-07-09 11:12       ` Mukunda,Vijendar
  -1 siblings, 0 replies; 14+ messages in thread
From: Mukunda,Vijendar @ 2022-07-09 11:12 UTC (permalink / raw)
  To: Christophe JAILLET, broonie, alsa-devel
  Cc: Sunil-kumar.Dommati, kernel test robot, open list,
	Basavaraj.Hiregoudar, Takashi Iwai, Liam Girdwood,
	amadeuszx.slawinski, zhuning

On 7/9/22 1:03 PM, Christophe JAILLET wrote:
> Le 07/07/2022 à 15:26, Vijendar Mukunda a écrit :
>> Fix below kernel warning.
>>>>> sound/soc/amd/acp-es8336.c:200:13: warning: variable 'ret' set but
>>>>> not used [-Wunused-but-set-variable]
>>
> 
> Hi,
> this patch, looks odd to me.
> 
> 
>> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
>> Reported-by: kernel test robot <lkp@intel.com>
>> ---
>>   sound/soc/amd/acp-es8336.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
>> index 90f4e5809c72..e1479ae684e9 100644
>> --- a/sound/soc/amd/acp-es8336.c
>> +++ b/sound/soc/amd/acp-es8336.c
>> @@ -206,6 +206,8 @@ static int st_es8336_late_probe(struct
>> snd_soc_card *card)
>>           dev_err(card->dev, "can not find codec dev\n");
> 
> The next devm_acpi_dev_add_driver_gpios() will fail, should we return
> immediately?
> 
>>         ret = devm_acpi_dev_add_driver_gpios(codec_dev,
>> acpi_es8336_gpios);
>> +    if (ret)
>> +        dev_warn(card->dev, "Failed to add driver gpios\n");
> 
> Should we return immediately?
As it required to support Machine driver differed probe , we shouldn't
return immediately.
We are checking gpiod_get_optional() return status. If still error is
reported, then return is invoked after checking whether return error
code is -EPROBE_DEFER.

We found similar implementation in other platforms machine driver code
as well.

>>         gpio_pa = gpiod_get_optional(codec_dev, "pa-enable",
>> GPIOD_OUT_LOW);
>>       if (IS_ERR(gpio_pa)) {
>> @@ -213,6 +215,7 @@ static int st_es8336_late_probe(struct
>> snd_soc_card *card)
>>                       "could not get pa-enable GPIO\n");
>>           gpiod_put(gpio_pa);
>>           put_device(codec_dev);
>> +        return ret;
> 
> Here, we return 'ret' which is what is returned by
> devm_acpi_dev_add_driver_gpios(). So there doesn't seem to be a link
> with this block which checks for gpiod_get_optional() errors.
> 
> Moreover, returning an error for something that is optional
> (gpiod_get_optional()) looks strange.
> 
> Finally, should an error be returned, maybe PTR_ERR(gpio_pa) would be
> better here.

Machine driver deferred probing should be supported.
err code PTR_ERR(gpio_pa) is compared with -EPROBE_DIFFER and same err
returned from dev_err_probe() API.

same code can also be modified as below

if (IS_ERR(gpio_pa)) {
	gpiod_put(gpio_pa);
	put_device(codec_dev);
	return dev_err_probe(card->dev, PTR_ERR(gpio_pa),
			    "could not get pa-enable GPIO\n");		

}





> 
> 
> Just my 2c.
> 
> CJ
> 
>>       }
>>       return 0;
>>   }
> 


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

* Re: [PATCH 3/3] ASoC: amd: fix for variable set but not used warning
@ 2022-07-09 11:12       ` Mukunda,Vijendar
  0 siblings, 0 replies; 14+ messages in thread
From: Mukunda,Vijendar @ 2022-07-09 11:12 UTC (permalink / raw)
  To: Christophe JAILLET, broonie, alsa-devel
  Cc: amadeuszx.slawinski, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	zhuning, kernel test robot, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, open list

On 7/9/22 1:03 PM, Christophe JAILLET wrote:
> Le 07/07/2022 à 15:26, Vijendar Mukunda a écrit :
>> Fix below kernel warning.
>>>>> sound/soc/amd/acp-es8336.c:200:13: warning: variable 'ret' set but
>>>>> not used [-Wunused-but-set-variable]
>>
> 
> Hi,
> this patch, looks odd to me.
> 
> 
>> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
>> Reported-by: kernel test robot <lkp@intel.com>
>> ---
>>   sound/soc/amd/acp-es8336.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
>> index 90f4e5809c72..e1479ae684e9 100644
>> --- a/sound/soc/amd/acp-es8336.c
>> +++ b/sound/soc/amd/acp-es8336.c
>> @@ -206,6 +206,8 @@ static int st_es8336_late_probe(struct
>> snd_soc_card *card)
>>           dev_err(card->dev, "can not find codec dev\n");
> 
> The next devm_acpi_dev_add_driver_gpios() will fail, should we return
> immediately?
> 
>>         ret = devm_acpi_dev_add_driver_gpios(codec_dev,
>> acpi_es8336_gpios);
>> +    if (ret)
>> +        dev_warn(card->dev, "Failed to add driver gpios\n");
> 
> Should we return immediately?
As it required to support Machine driver differed probe , we shouldn't
return immediately.
We are checking gpiod_get_optional() return status. If still error is
reported, then return is invoked after checking whether return error
code is -EPROBE_DEFER.

We found similar implementation in other platforms machine driver code
as well.

>>         gpio_pa = gpiod_get_optional(codec_dev, "pa-enable",
>> GPIOD_OUT_LOW);
>>       if (IS_ERR(gpio_pa)) {
>> @@ -213,6 +215,7 @@ static int st_es8336_late_probe(struct
>> snd_soc_card *card)
>>                       "could not get pa-enable GPIO\n");
>>           gpiod_put(gpio_pa);
>>           put_device(codec_dev);
>> +        return ret;
> 
> Here, we return 'ret' which is what is returned by
> devm_acpi_dev_add_driver_gpios(). So there doesn't seem to be a link
> with this block which checks for gpiod_get_optional() errors.
> 
> Moreover, returning an error for something that is optional
> (gpiod_get_optional()) looks strange.
> 
> Finally, should an error be returned, maybe PTR_ERR(gpio_pa) would be
> better here.

Machine driver deferred probing should be supported.
err code PTR_ERR(gpio_pa) is compared with -EPROBE_DIFFER and same err
returned from dev_err_probe() API.

same code can also be modified as below

if (IS_ERR(gpio_pa)) {
	gpiod_put(gpio_pa);
	put_device(codec_dev);
	return dev_err_probe(card->dev, PTR_ERR(gpio_pa),
			    "could not get pa-enable GPIO\n");		

}





> 
> 
> Just my 2c.
> 
> CJ
> 
>>       }
>>       return 0;
>>   }
> 


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

* Re: [PATCH 3/3] ASoC: amd: fix for variable set but not used warning
  2022-07-09 11:12       ` Mukunda,Vijendar
@ 2022-07-11  2:59         ` Zhu Ning
  -1 siblings, 0 replies; 14+ messages in thread
From: Zhu Ning @ 2022-07-11  2:59 UTC (permalink / raw)
  To: vijendar.mukunda
  Cc: Basavaraj.Hiregoudar, Sunil-kumar.Dommati, alsa-devel,
	amadeuszx.slawinski, broonie, christophe.jaillet, lgirdwood,
	linux-kernel, lkp, tiwai, zhuning

This code is ok. The machine driver should still function well without gpio.

if (IS_ERR(gpio_pa)) {
        gpiod_put(gpio_pa);
        put_device(codec_dev);
        return dev_err_probe(card->dev, PTR_ERR(gpio_pa),
                                            "could not get pa-enable GPIO\n");

}

You donnot need to handle null gpio_pa gpio.

if (!(IS_ERR_OR_NULL(gpio_pa))) 
	gpiod_set_value_cansleep(gpio_pa, true);

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

* Re: [PATCH 3/3] ASoC: amd: fix for variable set but not used warning
@ 2022-07-11  2:59         ` Zhu Ning
  0 siblings, 0 replies; 14+ messages in thread
From: Zhu Ning @ 2022-07-11  2:59 UTC (permalink / raw)
  To: vijendar.mukunda
  Cc: alsa-devel, Sunil-kumar.Dommati, lkp, Basavaraj.Hiregoudar,
	tiwai, lgirdwood, linux-kernel, broonie, christophe.jaillet,
	amadeuszx.slawinski, zhuning

This code is ok. The machine driver should still function well without gpio.

if (IS_ERR(gpio_pa)) {
        gpiod_put(gpio_pa);
        put_device(codec_dev);
        return dev_err_probe(card->dev, PTR_ERR(gpio_pa),
                                            "could not get pa-enable GPIO\n");

}

You donnot need to handle null gpio_pa gpio.

if (!(IS_ERR_OR_NULL(gpio_pa))) 
	gpiod_set_value_cansleep(gpio_pa, true);

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

end of thread, other threads:[~2022-07-11  3:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-07 13:26 [PATCH 1/3] ASoC: amd: remove unused header file inclusion Vijendar Mukunda
2022-07-07 13:26 ` Vijendar Mukunda
2022-07-07 13:26 ` [PATCH 2/3] ASoC: amd: drop machine driver remove function Vijendar Mukunda
2022-07-07 13:26   ` Vijendar Mukunda
2022-07-07 13:26 ` [PATCH 3/3] ASoC: amd: fix for variable set but not used warning Vijendar Mukunda
2022-07-07 13:26   ` Vijendar Mukunda
2022-07-09  7:33   ` Christophe JAILLET
2022-07-09  7:33     ` Christophe JAILLET
2022-07-09 11:12     ` Mukunda,Vijendar
2022-07-09 11:12       ` Mukunda,Vijendar
2022-07-11  2:59       ` Zhu Ning
2022-07-11  2:59         ` Zhu Ning
2022-07-08 20:47 ` [PATCH 1/3] ASoC: amd: remove unused header file inclusion Mark Brown
2022-07-08 20:47   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.