drm/imx: imx-ldb: check if channel is enabled before printing warning
authorLucas Stach <l.stach@pengutronix.de>
Wed, 11 Apr 2018 15:31:36 +0000 (17:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:18:34 +0000 (09:18 +0200)
[ Upstream commit c80d673b91a6c81d765864e10f2b15110ee900ad ]

If the second LVDS channel has been disabled in the DT when using dual-channel
mode we should not print a warning.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/imx/imx-ldb.c

index e1226b7..31ca56e 100644 (file)
@@ -569,14 +569,14 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
                if (ret || i < 0 || i > 1)
                        return -EINVAL;
 
+               if (!of_device_is_available(child))
+                       continue;
+
                if (dual && i > 0) {
                        dev_warn(dev, "dual-channel mode, ignoring second output\n");
                        continue;
                }
 
-               if (!of_device_is_available(child))
-                       continue;
-
                channel = &imx_ldb->channel[i];
                channel->ldb = imx_ldb;
                channel->chno = i;