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

ASoC: SOF: Intel: Initialize chip in hda_sdw_check_wakeen_irq()

Clang warns (or errors with CONFIG_WERROR):

sound/soc/sof/intel/hda.c:423:6: error: variable 'chip' is uninitialized when used here [-Werror,-Wuninitialized]
423 | if (chip && chip->check_sdw_wakeen_irq)
| ^~~~
sound/soc/sof/intel/hda.c:418:39: note: initialize the variable 'chip' to silence this warning
418 | const struct sof_intel_dsp_desc *chip;
| ^
| = NULL
1 error generated.

Add the missing initialization, following the pattern of the other irq
functions.

Fixes: 9362ab78f175 ("ASoC: SOF: Intel: add abstraction for SoundWire wake-ups")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230809-intel-hda-missing-chip-init-v1-1-61557ca6fa8a@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Nathan Chancellor and committed by
Mark Brown
9c28423d 81113108

+1
+1
sound/soc/sof/intel/hda.c
··· 420 420 if (!(interface_mask & BIT(SOF_DAI_INTEL_ALH))) 421 421 return false; 422 422 423 + chip = get_chip_info(sdev->pdata); 423 424 if (chip && chip->check_sdw_wakeen_irq) 424 425 return chip->check_sdw_wakeen_irq(sdev); 425 426