Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: hda/senary: Replace magic numbers with defined constants

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>

authored by

wangdicheng and committed by
Takashi Iwai
592d1c23 79d062bd

+6 -3
+6 -3
sound/hda/codecs/senarytech.c
··· 19 19 #include "hda_jack.h" 20 20 #include "generic.h" 21 21 22 + /* GPIO node ID */ 23 + #define SENARY_GPIO_NODE 0x01 24 + 22 25 struct senary_spec { 23 26 struct hda_gen_spec gen; 24 27 ··· 123 120 unsigned int mask = spec->gpio_mute_led_mask | spec->gpio_mic_led_mask; 124 121 125 122 if (mask) { 126 - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, 123 + snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_MASK, 127 124 mask); 128 - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, 125 + snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_DIRECTION, 129 126 mask); 130 - snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 127 + snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_DATA, 131 128 spec->gpio_led); 132 129 } 133 130 }