]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: codecs: ab8500: Fix casting of private data
authorChristian A. Ehrhardt <christian.ehrhardt@codasip.com>
Tue, 28 Apr 2026 19:22:49 +0000 (21:22 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 29 Apr 2026 00:47:39 +0000 (09:47 +0900)
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: 679d7abdc754 ("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>
sound/soc/codecs/ab8500-codec.c

index fdda1b747bf7e5fbdc37b6966703fafab3d38e56..8ab2e60f80b4ffa07599b1a0457c2b34997d5beb 100644 (file)
@@ -2496,13 +2496,13 @@ static int ab8500_codec_probe(struct snd_soc_component *component)
                return status;
        }
        fc = (struct filter_control *)
-               &ab8500_filter_controls[AB8500_FILTER_ANC_FIR].private_value;
+               ab8500_filter_controls[AB8500_FILTER_ANC_FIR].private_value;
        drvdata->anc_fir_values = (long *)fc->value;
        fc = (struct filter_control *)
-               &ab8500_filter_controls[AB8500_FILTER_ANC_IIR].private_value;
+               ab8500_filter_controls[AB8500_FILTER_ANC_IIR].private_value;
        drvdata->anc_iir_values = (long *)fc->value;
        fc = (struct filter_control *)
-               &ab8500_filter_controls[AB8500_FILTER_SID_FIR].private_value;
+               ab8500_filter_controls[AB8500_FILTER_SID_FIR].private_value;
        drvdata->sid_fir_values = (long *)fc->value;
 
        snd_soc_dapm_disable_pin(dapm, "ANC Configure Input");