Skip to content

Commit 853fe4f

Browse files
Marco FelschpH5
authored andcommitted
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 <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Philipp Zabel <[email protected]>
1 parent 8e91cbb commit 853fe4f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpu/drm/imx/parallel-display.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,12 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
320320
imxpd = dev_get_drvdata(dev);
321321
memset(imxpd, 0, sizeof(*imxpd));
322322

323+
/* port@1 is the output port */
324+
ret = drm_of_find_panel_or_bridge(np, 1, 0, &imxpd->panel,
325+
&imxpd->next_bridge);
326+
if (ret && ret != -ENODEV)
327+
return ret;
328+
323329
edidp = of_get_property(np, "edid", &imxpd->edid_len);
324330
if (edidp)
325331
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)
337343
}
338344
imxpd->bus_format = bus_format;
339345

340-
/* port@1 is the output port */
341-
ret = drm_of_find_panel_or_bridge(np, 1, 0, &imxpd->panel,
342-
&imxpd->next_bridge);
343-
if (ret && ret != -ENODEV)
344-
return ret;
345-
346346
imxpd->dev = dev;
347347

348348
ret = imx_pd_register(drm, imxpd);

0 commit comments

Comments
 (0)