Unverified Commit 240fdf3f authored by Aakash Hemadri's avatar Aakash Hemadri Committed by Mark Brown
Browse files

ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data



const struct of_device_id incorrectly assigned "match->data" using
    of_device_get_match_data()

Instead assign `const struct tegra30_i2s_soc_data *soc_data` with
const void *of_device_get_match_data(...)

Fixes: 356b94a3 ("ASoC: tegra30: i2s: Use of_device_get_match_data")

Signed-off-by: default avatarAakash Hemadri <aakashhemadri123@gmail.com>
Link: https://lore.kernel.org/r/4805c7fcd35c8deada63d41cb34d40de80f85a13.1629148177.git.aakashhemadri123@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ea2efede
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -406,7 +406,7 @@ static const struct of_device_id tegra30_i2s_of_match[] = {
static int tegra30_i2s_platform_probe(struct platform_device *pdev)
{
	struct tegra30_i2s *i2s;
	const struct of_device_id *match;
	const struct tegra30_i2s_soc_data *soc_data;
	u32 cif_ids[2];
	void __iomem *regs;
	int ret;
@@ -418,13 +418,13 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
	}
	dev_set_drvdata(&pdev->dev, i2s);

	match = of_device_get_match_data(&pdev->dev);
	if (!match) {
	soc_data = of_device_get_match_data(&pdev->dev);
	if (!soc_data) {
		dev_err(&pdev->dev, "Error: No device match found\n");
		ret = -ENODEV;
		goto err;
	}
	i2s->soc_data = (struct tegra30_i2s_soc_data *)match->data;
	i2s->soc_data = soc_data;

	i2s->dai = tegra30_i2s_dai_template;
	i2s->dai.name = dev_name(&pdev->dev);