gpu: ipu-v3: default to id 0 on missing OF alias

This is better than storing -ENODEV in the id number. This fixes SoCs
with only one IPU that don't specify an IPU alias in the device tree.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Philipp Zabel 2018-06-21 21:13:38 +02:00
parent 9f0ba3d92f
commit 2d87e6c1b9
1 changed files with 2 additions and 0 deletions

View File

@ -1401,6 +1401,8 @@ static int ipu_probe(struct platform_device *pdev)
return -ENODEV;
ipu->id = of_alias_get_id(np, "ipu");
if (ipu->id < 0)
ipu->id = 0;
if (of_device_is_compatible(np, "fsl,imx6qp-ipu") &&
IS_ENABLED(CONFIG_DRM)) {