ASoC: mediatek: mt8365-mt6357: tidyup mach_priv

It sets soc_card_data (1) in Card private data at (A), but the function (z)
after that gets it as priv (2) at (B). These are different data (*).

(z)	static int mt8365_mt6357_gpio_probe(...)
	{
(B)		struct mt8365_mt6357_priv *priv = snd_soc_card_get_drvdata(card);
		...			   ^^^^(2)	       ^^^^^^^^^^^
	}

	static int mt8365_mt6357_dev_probe(*soc_card_data, ...)
	{				    ^^^^^^^^^^^^^(1)
		...
		struct mt8365_mt6357_priv *mach_priv;
		...			   ^^^^^^^^^(2)
(*)		soc_card_data->mach_priv = mach_priv;
		^^^^^^^^^^^^^(1)	   ^^^^^^^^^(2)
(A)		snd_soc_card_set_drvdata(card, soc_card_data);
		             ^^^^^^^^^^^       ^^^^^^^^^^^^^(1)
(z)		mt8365_mt6357_gpio_probe(card);
		...
	}

Depending on the defined order in the struct (s), they may be the same
pointer, but mach_priv (2) is not top of soc_card_data (1), thus the
function (z) is getting wrong pointer. Fix it.

		(1)
(s)	struct mtk_soc_card_data {
		const struct mtk_sof_priv *sof_priv;
		...
		void *mach_priv;
	};	(2)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87qzlteuae.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2026-06-26 05:37:45 +00:00 • committed by Mark Brown
commit 8aa079a408
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0