From: Andy Yan Date: Fri, 5 Dec 2014 06:24:28 +0000 (+0800) Subject: drm: imx: imx-hdmi: return defer if can't get ddc i2c adapter X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2c3848851a723a0e5e0fec22df395a885edf459;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm: imx: imx-hdmi: return defer if can't get ddc i2c adapter drm driver may probe before the i2c bus, so the driver should defer probing until it is available Signed-off-by: Andy Yan Reviewed-by: Daniel Kurtz Tested-by: Russell King Acked-by: Russell King Signed-off-by: Philipp Zabel --- diff --git a/drivers/gpu/drm/imx/imx-hdmi.c b/drivers/gpu/drm/imx/imx-hdmi.c index 3f96a5e6670d..3118dde3ea62 100644 --- a/drivers/gpu/drm/imx/imx-hdmi.c +++ b/drivers/gpu/drm/imx/imx-hdmi.c @@ -1611,10 +1611,12 @@ static int imx_hdmi_bind(struct device *dev, struct device *master, void *data) ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0); if (ddc_node) { hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node); - if (!hdmi->ddc) + of_node_put(ddc_node); + if (!hdmi->ddc) { dev_dbg(hdmi->dev, "failed to read ddc node\n"); + return -EPROBE_DEFER; + } - of_node_put(ddc_node); } else { dev_dbg(hdmi->dev, "no ddc property found\n"); }