Skip to content

Commit f68db04

Browse files
Christian A. Ehrhardtgregkh
authored andcommitted
ASoC: codecs: ab8500: Fix casting of private data
[ Upstream commit a201aef ] ab8500_filter_controls[i].private_value is initialized using .private_value = (unsigned long)&(struct filter_control) {.count = xcount, .min = xmin, .max = xmax} thus it's a pointer to a struct filter_control casted to unsigned long. So to get back that pointer .private_data must be cast back, not its address. Fixes: 679d7ab ("ASoC: codecs: Add AB8500 codec-driver") Signed-off-by: Christian A. Ehrhardt <christian.ehrhardt@codasip.com> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/20260428192255.2294705-2-u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3a55ff1 commit f68db04

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sound/soc/codecs/ab8500-codec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,13 +2496,13 @@ static int ab8500_codec_probe(struct snd_soc_component *component)
24962496
return status;
24972497
}
24982498
fc = (struct filter_control *)
2499-
&ab8500_filter_controls[AB8500_FILTER_ANC_FIR].private_value;
2499+
ab8500_filter_controls[AB8500_FILTER_ANC_FIR].private_value;
25002500
drvdata->anc_fir_values = (long *)fc->value;
25012501
fc = (struct filter_control *)
2502-
&ab8500_filter_controls[AB8500_FILTER_ANC_IIR].private_value;
2502+
ab8500_filter_controls[AB8500_FILTER_ANC_IIR].private_value;
25032503
drvdata->anc_iir_values = (long *)fc->value;
25042504
fc = (struct filter_control *)
2505-
&ab8500_filter_controls[AB8500_FILTER_SID_FIR].private_value;
2505+
ab8500_filter_controls[AB8500_FILTER_SID_FIR].private_value;
25062506
drvdata->sid_fir_values = (long *)fc->value;
25072507

25082508
snd_soc_dapm_disable_pin(dapm, "ANC Configure Input");

0 commit comments

Comments
 (0)