summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2019-11-20 17:54:59 +0100
committerPhilipp Zabel <p.zabel@pengutronix.de>2020-07-20 15:16:05 +0200
commit853fe4fc757246a2da6258f1dd249e71a1bd14fd (patch)
tree2da68fef1f46aac1ef452458535b04627c980651 /drivers/gpu
parent8e91cbb820981a8a51be55499f860b1968308960 (diff)
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: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/imx/parallel-display.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index 6e55bf98b05f..a831b5bd1613 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -320,6 +320,12 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
imxpd = dev_get_drvdata(dev);
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);
if (edidp)
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)
}
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;
ret = imx_pd_register(drm, imxpd);