* [PATCH] ALSA: hda/senary: Replace magic numbers with defined constants
@ 2025-11-06 6:36 wangdich9700
2025-11-06 10:04 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: wangdich9700 @ 2025-11-06 6:36 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai
Cc: linux-kernel, linux-sound, linux-arm-kernel, wangdicheng,
wangdicheng
From: wangdicheng <wangdich9700@163.com>
Replace hardcoded GPIO node value with a defined constant for better
code readability and maintainability.
Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
---
sound/hda/codecs/senarytech.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sound/hda/codecs/senarytech.c b/sound/hda/codecs/senarytech.c
index 99af8d5e51db..d61d57538bc9 100644
--- a/sound/hda/codecs/senarytech.c
+++ b/sound/hda/codecs/senarytech.c
@@ -19,6 +19,9 @@
#include "hda_jack.h"
#include "generic.h"
+/* GPIO node ID */
+#define SENARY_GPIO_NODE 0x01
+
struct senary_spec {
struct hda_gen_spec gen;
@@ -131,11 +134,11 @@ static void senary_init_gpio_led(struct hda_codec *codec)
unsigned int mask = spec->gpio_mute_led_mask | spec->gpio_mic_led_mask;
if (mask) {
- snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK,
+ snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_MASK,
mask);
- snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION,
+ snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_DIRECTION,
mask);
- snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
+ snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_DATA,
spec->gpio_led);
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ALSA: hda/senary: Replace magic numbers with defined constants
2025-11-06 6:36 [PATCH] ALSA: hda/senary: Replace magic numbers with defined constants wangdich9700
@ 2025-11-06 10:04 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2025-11-06 10:04 UTC (permalink / raw)
To: wangdich9700
Cc: lgirdwood, broonie, perex, tiwai, linux-kernel, linux-sound,
linux-arm-kernel, wangdicheng
On Thu, 06 Nov 2025 07:36:26 +0100,
wangdich9700@163.com wrote:
>
> From: wangdicheng <wangdich9700@163.com>
>
> Replace hardcoded GPIO node value with a defined constant for better
> code readability and maintainability.
>
> Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
Please try to align both From and Signed-off-by addresses.
thanks,
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-06 10:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06 6:36 [PATCH] ALSA: hda/senary: Replace magic numbers with defined constants wangdich9700
2025-11-06 10:04 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox