ASoC: tegra: Fix -Wuninitialized in tegra210_amx_platform_probe()

Clang warns (or errors with CONFIG_WERROR=y):

  sound/soc/tegra/tegra210_amx.c:553:10: error: variable 'soc_data' is uninitialized when used here [-Werror,-Wuninitialized]
    553 |                                             soc_data->regmap_conf);
        |                                             ^~~~~~~~

A refactoring removed the initialization of this variable but its use
was not updated. Use the soc_data value in the amx variable to resolve
the warning and remove the soc_data variable, as it is now entirely
unused.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1943
Fixes: 9958d85968ed ("ASoC: Use device_get_match_data()")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20231011-asoc-tegra-fix-uninit-soc_data-v1-1-0ef0ab44cf48@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Nathan Chancellor 2023-10-11 13:21:51 -07:00 committed by Mark Brown
parent 5982595170
commit 41cb1126be
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -535,7 +535,6 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev)
struct tegra210_amx *amx; struct tegra210_amx *amx;
void __iomem *regs; void __iomem *regs;
int err; int err;
struct tegra210_amx_soc_data *soc_data;
amx = devm_kzalloc(dev, sizeof(*amx), GFP_KERNEL); amx = devm_kzalloc(dev, sizeof(*amx), GFP_KERNEL);
if (!amx) if (!amx)
@ -550,7 +549,7 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev)
return PTR_ERR(regs); return PTR_ERR(regs);
amx->regmap = devm_regmap_init_mmio(dev, regs, amx->regmap = devm_regmap_init_mmio(dev, regs,
soc_data->regmap_conf); amx->soc_data->regmap_conf);
if (IS_ERR(amx->regmap)) { if (IS_ERR(amx->regmap)) {
dev_err(dev, "regmap init failed\n"); dev_err(dev, "regmap init failed\n");
return PTR_ERR(amx->regmap); return PTR_ERR(amx->regmap);