Commit 853fe4fc authored by Marco Felsch's avatar Marco Felsch Committed by Philipp Zabel

drm/imx: parallel-display: move panel/bridge detection to fail early

We do some string parsing and string comparison in front of
drm_of_find_panel_or_bridge(). All this work is useless if the call
fails. Move drm_of_find_panel_or_bridge() infront of the parsing work to
fail early.
Signed-off-by: default avatarMarco Felsch <m.felsch@pengutronix.de>
Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent 8e91cbb8
...@@ -320,6 +320,12 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data) ...@@ -320,6 +320,12 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
imxpd = dev_get_drvdata(dev); imxpd = dev_get_drvdata(dev);
memset(imxpd, 0, sizeof(*imxpd)); memset(imxpd, 0, sizeof(*imxpd));
/* port@1 is the output port */
ret = drm_of_find_panel_or_bridge(np, 1, 0, &imxpd->panel,
&imxpd->next_bridge);
if (ret && ret != -ENODEV)
return ret;
edidp = of_get_property(np, "edid", &imxpd->edid_len); edidp = of_get_property(np, "edid", &imxpd->edid_len);
if (edidp) if (edidp)
imxpd->edid = kmemdup(edidp, imxpd->edid_len, GFP_KERNEL); imxpd->edid = kmemdup(edidp, imxpd->edid_len, GFP_KERNEL);
...@@ -337,12 +343,6 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data) ...@@ -337,12 +343,6 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
} }
imxpd->bus_format = bus_format; imxpd->bus_format = bus_format;
/* port@1 is the output port */
ret = drm_of_find_panel_or_bridge(np, 1, 0, &imxpd->panel,
&imxpd->next_bridge);
if (ret && ret != -ENODEV)
return ret;
imxpd->dev = dev; imxpd->dev = dev;
ret = imx_pd_register(drm, imxpd); ret = imx_pd_register(drm, imxpd);
......
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