Commit a85227da authored by Marcel Ziswiler's avatar Marcel Ziswiler Committed by Mark Brown

ASoC: tegra_sgtl5000: fix device_node refcounting

Similar to the following:

commit 43217236 ("ASoC: tegra_alc5632: fix device_node refcounting")

commit 7c5dfd54 ("ASoC: tegra: fix device_node refcounting")
Signed-off-by: default avatarMarcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7e95aac9
...@@ -149,14 +149,14 @@ static int tegra_sgtl5000_driver_probe(struct platform_device *pdev) ...@@ -149,14 +149,14 @@ static int tegra_sgtl5000_driver_probe(struct platform_device *pdev)
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Property 'nvidia,i2s-controller' missing/invalid\n"); "Property 'nvidia,i2s-controller' missing/invalid\n");
ret = -EINVAL; ret = -EINVAL;
goto err; goto err_put_codec_of_node;
} }
tegra_sgtl5000_dai.platform_of_node = tegra_sgtl5000_dai.cpu_of_node; tegra_sgtl5000_dai.platform_of_node = tegra_sgtl5000_dai.cpu_of_node;
ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev); ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev);
if (ret) if (ret)
goto err; goto err_put_cpu_of_node;
ret = snd_soc_register_card(card); ret = snd_soc_register_card(card);
if (ret) { if (ret) {
...@@ -169,6 +169,13 @@ static int tegra_sgtl5000_driver_probe(struct platform_device *pdev) ...@@ -169,6 +169,13 @@ static int tegra_sgtl5000_driver_probe(struct platform_device *pdev)
err_fini_utils: err_fini_utils:
tegra_asoc_utils_fini(&machine->util_data); tegra_asoc_utils_fini(&machine->util_data);
err_put_cpu_of_node:
of_node_put(tegra_sgtl5000_dai.cpu_of_node);
tegra_sgtl5000_dai.cpu_of_node = NULL;
tegra_sgtl5000_dai.platform_of_node = NULL;
err_put_codec_of_node:
of_node_put(tegra_sgtl5000_dai.codec_of_node);
tegra_sgtl5000_dai.codec_of_node = NULL;
err: err:
return ret; return ret;
} }
...@@ -183,6 +190,12 @@ static int tegra_sgtl5000_driver_remove(struct platform_device *pdev) ...@@ -183,6 +190,12 @@ static int tegra_sgtl5000_driver_remove(struct platform_device *pdev)
tegra_asoc_utils_fini(&machine->util_data); tegra_asoc_utils_fini(&machine->util_data);
of_node_put(tegra_sgtl5000_dai.cpu_of_node);
tegra_sgtl5000_dai.cpu_of_node = NULL;
tegra_sgtl5000_dai.platform_of_node = NULL;
of_node_put(tegra_sgtl5000_dai.codec_of_node);
tegra_sgtl5000_dai.codec_of_node = NULL;
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment