[PATCH] staging: greybus: audio: Limit scope of jack-related variables

From: Lee Yongjun

Date: Tue Jan 20 2026 - 02:07:37 EST


Move jack-related variable declarations inside the CONFIG_SND_JACK
conditional block.

These variables are only used when CONFIG_SND_JACK is enabled, so
limiting their scope improves code clarity and avoids unused variable
warnings when the option is disabled.

No functional changes intended.

Signed-off-by: Lee Yongjun <jun85566@xxxxxxxxx>
---
drivers/staging/greybus/audio_codec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
index 444c53b4e08d..f752d5fbd685 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -935,8 +935,6 @@ static void gbaudio_codec_cleanup(struct gbaudio_module_info *module)
void gbaudio_unregister_module(struct gbaudio_module_info *module)
{
struct snd_soc_component *comp = gbcodec->component;
- struct gbaudio_jack *jack, *n;
- int mask;

dev_dbg(comp->dev, "Unregister %s module\n", module->name);

@@ -948,6 +946,8 @@ void gbaudio_unregister_module(struct gbaudio_module_info *module)
mutex_unlock(&gbcodec->lock);

#ifdef CONFIG_SND_JACK
+ struct gbaudio_jack *jack, *n;
+ int mask;
/* free jack devices for this module jack_list */
list_for_each_entry_safe(jack, n, &module->jack_list, list) {
if (jack == &module->headset)
--
2.34.1