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

ASoC: dwc: Ensure i2s_reg_comp{1,2} is always initialised

In the case that the driver is configured from device-tree
i2s_reg_comp1 and i2s_reg_comp2 aren't initialised, breaking the driver.
Fix this by unconditionally setting these values before checking for quirks.

Fixes: a242cac1d3aa ("ASoC: dwc: add quirk to override COMP_PARAM_1 register")
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jon Medhurst (Tixy) and committed by
Mark Brown
d2f916aa 92e963f5

+2 -3
+2 -3
sound/soc/dwc/designware_i2s.c
··· 645 645 646 646 dev->dev = &pdev->dev; 647 647 648 + dev->i2s_reg_comp1 = I2S_COMP_PARAM_1; 649 + dev->i2s_reg_comp2 = I2S_COMP_PARAM_2; 648 650 if (pdata) { 649 651 dev->capability = pdata->cap; 650 652 clk_id = NULL; ··· 654 652 if (dev->quirks & DW_I2S_QUIRK_COMP_REG_OFFSET) { 655 653 dev->i2s_reg_comp1 = pdata->i2s_reg_comp1; 656 654 dev->i2s_reg_comp2 = pdata->i2s_reg_comp2; 657 - } else { 658 - dev->i2s_reg_comp1 = I2S_COMP_PARAM_1; 659 - dev->i2s_reg_comp2 = I2S_COMP_PARAM_2; 660 655 } 661 656 ret = dw_configure_dai_by_pd(dev, dw_i2s_dai, res, pdata); 662 657 } else {