drm: imx: imx-hdmi: return defer if can't get ddc i2c adapter
authorAndy Yan <andy.yan@rock-chips.com>
Fri, 5 Dec 2014 06:24:28 +0000 (14:24 +0800)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 6 Jan 2015 16:36:15 +0000 (17:36 +0100)
drm driver may probe before the i2c bus, so the driver should
defer probing until it is available

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/drm/imx/imx-hdmi.c

index 3f96a5e6670d4c44dc1b305fb5f2b1c1178f8b25..3118dde3ea62ea57924fb27c87a0b31f829630fc 100644 (file)
@@ -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");
        }