]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda/senary: Replace magic numbers with defined constants
authorwangdicheng <wangdicheng@kylinos.cn>
Fri, 7 Nov 2025 02:40:30 +0000 (10:40 +0800)
committerTakashi Iwai <tiwai@suse.de>
Sat, 8 Nov 2025 07:54:29 +0000 (08:54 +0100)
Replace hardcoded GPIO node value with a defined constant for better
code readability and maintainability.

Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
Link: https://patch.msgid.link/20251107024030.36712-1-wangdich9700@163.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/hda/codecs/senarytech.c

index 9aa1e9bcd9ec0561a63effff762533e00aea7654..63cda57cf7868eb7ad1babe282521a2ade78e0c4 100644 (file)
@@ -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;
 
@@ -120,11 +123,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);
        }
 }