From: Philipp Zabel
Date: Thu, 21 Jun 2018 19:13:38 +0000 (+0200)
Subject: gpu: ipu-v3: default to id 0 on missing OF alias
X-Git-Tag: v4.19-rc1~138^2~1^2
X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d87e6c1b99c402360fdfe19ce4f579ab2f96adf;p=thirdparty%2Fkernel%2Flinux.git
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
---
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index 48685cddbad1b..c73bd003f845d 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -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)) {