Commit 643ae131 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Thierry Reding

drm/tegra: hdmi: Fix some error handling paths in tegra_hdmi_probe()

If an error occurs after calling tegra_output_probe(),
tegra_output_remove() should be called as already done in the remove
function.

Fixes: 59d29c0e ("drm/tegra: Allocate resources at probe time")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/9b7c564eb71977678b20abd73ee52001a51cf327.1693667005.git.christophe.jaillet@wanadoo.fr
parent 5286a9fc
...@@ -1856,12 +1856,14 @@ static int tegra_hdmi_probe(struct platform_device *pdev) ...@@ -1856,12 +1856,14 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
return err; return err;
hdmi->regs = devm_platform_ioremap_resource(pdev, 0); hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(hdmi->regs)) if (IS_ERR(hdmi->regs)) {
return PTR_ERR(hdmi->regs); err = PTR_ERR(hdmi->regs);
goto remove;
}
err = platform_get_irq(pdev, 0); err = platform_get_irq(pdev, 0);
if (err < 0) if (err < 0)
return err; goto remove;
hdmi->irq = err; hdmi->irq = err;
...@@ -1870,18 +1872,18 @@ static int tegra_hdmi_probe(struct platform_device *pdev) ...@@ -1870,18 +1872,18 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
if (err < 0) { if (err < 0) {
dev_err(&pdev->dev, "failed to request IRQ#%u: %d\n", dev_err(&pdev->dev, "failed to request IRQ#%u: %d\n",
hdmi->irq, err); hdmi->irq, err);
return err; goto remove;
} }
platform_set_drvdata(pdev, hdmi); platform_set_drvdata(pdev, hdmi);
err = devm_pm_runtime_enable(&pdev->dev); err = devm_pm_runtime_enable(&pdev->dev);
if (err) if (err)
return err; goto remove;
err = devm_tegra_core_dev_init_opp_table_common(&pdev->dev); err = devm_tegra_core_dev_init_opp_table_common(&pdev->dev);
if (err) if (err)
return err; goto remove;
INIT_LIST_HEAD(&hdmi->client.list); INIT_LIST_HEAD(&hdmi->client.list);
hdmi->client.ops = &hdmi_client_ops; hdmi->client.ops = &hdmi_client_ops;
...@@ -1891,10 +1893,14 @@ static int tegra_hdmi_probe(struct platform_device *pdev) ...@@ -1891,10 +1893,14 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
if (err < 0) { if (err < 0) {
dev_err(&pdev->dev, "failed to register host1x client: %d\n", dev_err(&pdev->dev, "failed to register host1x client: %d\n",
err); err);
return err; goto remove;
} }
return 0; return 0;
remove:
tegra_output_remove(&hdmi->output);
return err;
} }
static void tegra_hdmi_remove(struct platform_device *pdev) static void tegra_hdmi_remove(struct platform_device *pdev)
......
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