@@ -1199,13 +1199,16 @@ static int tegra_dc_probe(struct platform_device *pdev)
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dc->regs = devm_ioremap_resource(&pdev->dev, regs);
- if (IS_ERR(dc->regs))
- return PTR_ERR(dc->regs);
+ if (IS_ERR(dc->regs)) {
+ err = PTR_ERR(dc->regs);
+ goto err_clk_disable_unprepare;
+ }
dc->irq = platform_get_irq(pdev, 0);
if (dc->irq < 0) {
dev_err(&pdev->dev, "failed to get IRQ\n");
- return -ENXIO;
+ err = -ENXIO;
+ goto err_clk_disable_unprepare;
}
INIT_LIST_HEAD(&dc->client.list);
@@ -1215,19 +1218,24 @@ static int tegra_dc_probe(struct platform_device *pdev)
err = tegra_dc_rgb_probe(dc);
if (err < 0 && err != -ENODEV) {
dev_err(&pdev->dev, "failed to probe RGB output: %d\n", err);
- return err;
+ goto err_clk_disable_unprepare;
}
err = host1x_client_register(&dc->client);
if (err < 0) {
dev_err(&pdev->dev, "failed to register host1x client: %d\n",
err);
- return err;
+ goto err_rgb_remove;
}
platform_set_drvdata(pdev, dc);
return 0;
+err_rgb_remove:
+ tegra_dc_rgb_remove(dc);
+err_clk_disable_unprepare:
+ clk_disable_unprepare(dc->clk);
+ return err;
}
static int tegra_dc_remove(struct platform_device *pdev)