public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: madera: Use str_enabled_disabled() helper function
@ 2024-12-29 17:40 Thorsten Blum
  2025-01-06 16:02 ` Charles Keepax
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2024-12-29 17:40 UTC (permalink / raw)
  To: Charles Keepax, Richard Fitzgerald, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: Thorsten Blum, linux-sound, patches, linux-kernel

Remove hard-coded strings by using the str_enabled_disabled() helper
function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 sound/soc/codecs/madera.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c
index b24d6472ad5f..86abfbe56e1f 100644
--- a/sound/soc/codecs/madera.c
+++ b/sound/soc/codecs/madera.c
@@ -3965,7 +3965,7 @@ static int madera_enable_fll(struct madera_fll *fll)
 	}
 
 	madera_fll_dbg(fll, "Enabling FLL, initially %s\n",
-		       already_enabled ? "enabled" : "disabled");
+		       str_enabled_disabled(already_enabled));
 
 	if (fll->fout < MADERA_FLL_MIN_FOUT ||
 	    fll->fout > MADERA_FLL_MAX_FOUT) {
@@ -4252,7 +4252,7 @@ static int madera_enable_fll_ao(struct madera_fll *fll,
 		pm_runtime_get_sync(madera->dev);
 
 	madera_fll_dbg(fll, "Enabling FLL_AO, initially %s\n",
-		       already_enabled ? "enabled" : "disabled");
+		       str_enabled_disabled(already_enabled));
 
 	/* FLL_AO_HOLD must be set before configuring any registers */
 	regmap_update_bits(fll->madera->regmap,
@@ -4576,7 +4576,7 @@ static int madera_fllhj_enable(struct madera_fll *fll)
 		pm_runtime_get_sync(madera->dev);
 
 	madera_fll_dbg(fll, "Enabling FLL, initially %s\n",
-		       already_enabled ? "enabled" : "disabled");
+		       str_enabled_disabled(already_enabled));
 
 	/* FLLn_HOLD must be set before configuring any registers */
 	regmap_update_bits(fll->madera->regmap,
-- 
2.47.1


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

* Re: [PATCH] ASoC: madera: Use str_enabled_disabled() helper function
  2024-12-29 17:40 [PATCH] ASoC: madera: Use str_enabled_disabled() helper function Thorsten Blum
@ 2025-01-06 16:02 ` Charles Keepax
  0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2025-01-06 16:02 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Richard Fitzgerald, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-sound, patches, linux-kernel

On Sun, Dec 29, 2024 at 06:40:44PM +0100, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_enabled_disabled() helper
> function.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  sound/soc/codecs/madera.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c
> index b24d6472ad5f..86abfbe56e1f 100644
> --- a/sound/soc/codecs/madera.c
> +++ b/sound/soc/codecs/madera.c
> @@ -3965,7 +3965,7 @@ static int madera_enable_fll(struct madera_fll *fll)
>  	}
>  
>  	madera_fll_dbg(fll, "Enabling FLL, initially %s\n",
> -		       already_enabled ? "enabled" : "disabled");
> +		       str_enabled_disabled(already_enabled));
>  
>  	if (fll->fout < MADERA_FLL_MIN_FOUT ||
>  	    fll->fout > MADERA_FLL_MAX_FOUT) {
> @@ -4252,7 +4252,7 @@ static int madera_enable_fll_ao(struct madera_fll *fll,
>  		pm_runtime_get_sync(madera->dev);
>  
>  	madera_fll_dbg(fll, "Enabling FLL_AO, initially %s\n",
> -		       already_enabled ? "enabled" : "disabled");
> +		       str_enabled_disabled(already_enabled));
>  
>  	/* FLL_AO_HOLD must be set before configuring any registers */
>  	regmap_update_bits(fll->madera->regmap,
> @@ -4576,7 +4576,7 @@ static int madera_fllhj_enable(struct madera_fll *fll)
>  		pm_runtime_get_sync(madera->dev);
>  
>  	madera_fll_dbg(fll, "Enabling FLL, initially %s\n",
> -		       already_enabled ? "enabled" : "disabled");
> +		       str_enabled_disabled(already_enabled));
>  
>  	/* FLLn_HOLD must be set before configuring any registers */
>  	regmap_update_bits(fll->madera->regmap,

This should also add an include for the string_choices header,
but otherwise looks fine to me.

Thanks,
Charles

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

end of thread, other threads:[~2025-01-06 16:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-29 17:40 [PATCH] ASoC: madera: Use str_enabled_disabled() helper function Thorsten Blum
2025-01-06 16:02 ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox