Skip to content

Commit

Permalink
drm/rockchip: inno_hdmi: Fix error handling path.
Browse files Browse the repository at this point in the history
Add missing error handling in bind().

Fixes: 412d4ae ("drm/rockchip: hdmi: add Innosilicon HDMI support")
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
[moved clk_disable_unprepare reordering in unbind to separate patch]
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20180302175757.28192-3-enric.balletbo@collabora.com
  • Loading branch information
JeffyCN authored and mmind committed Mar 8, 2018
1 parent e45df26 commit 61b5ff9
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions drivers/gpu/drm/rockchip/inno_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,16 +849,18 @@ static int inno_hdmi_bind(struct device *dev, struct device *master,
}

irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
if (irq < 0) {
ret = irq;
goto err_disable_clk;
}

inno_hdmi_reset(hdmi);

hdmi->ddc = inno_hdmi_i2c_adapter(hdmi);
if (IS_ERR(hdmi->ddc)) {
ret = PTR_ERR(hdmi->ddc);
hdmi->ddc = NULL;
return ret;
goto err_disable_clk;
}

/*
Expand All @@ -872,7 +874,7 @@ static int inno_hdmi_bind(struct device *dev, struct device *master,

ret = inno_hdmi_register(drm, hdmi);
if (ret)
return ret;
goto err_put_adapter;

dev_set_drvdata(dev, hdmi);

Expand All @@ -882,7 +884,17 @@ static int inno_hdmi_bind(struct device *dev, struct device *master,
ret = devm_request_threaded_irq(dev, irq, inno_hdmi_hardirq,
inno_hdmi_irq, IRQF_SHARED,
dev_name(dev), hdmi);
if (ret < 0)
goto err_cleanup_hdmi;

return 0;
err_cleanup_hdmi:
hdmi->connector.funcs->destroy(&hdmi->connector);
hdmi->encoder.funcs->destroy(&hdmi->encoder);
err_put_adapter:
i2c_put_adapter(hdmi->ddc);
err_disable_clk:
clk_disable_unprepare(hdmi->pclk);
return ret;
}

Expand Down

0 comments on commit 61b5ff9

Please sign in to comment.