[PATCH 2/5] video: imx-hdmi: search for DDC node only when EDID support is enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This uses i2c functions that may not be available in every configuration
and is only needed if EDID support is enabled, which in turn already
selects I2C.

Fixes:
drivers/video/imx-ipu-v3/imx-hdmi.c:
undefined reference to `of_find_i2c_adapter_by_node'

Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
---
 drivers/video/imx-ipu-v3/imx-hdmi.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/video/imx-ipu-v3/imx-hdmi.c b/drivers/video/imx-ipu-v3/imx-hdmi.c
index 4f462889a873..2da76a4b7a74 100644
--- a/drivers/video/imx-ipu-v3/imx-hdmi.c
+++ b/drivers/video/imx-ipu-v3/imx-hdmi.c
@@ -1190,16 +1190,18 @@ static int imx_hdmi_probe(struct device_d *dev)
 	if (ret)
 		return ret;
 
-	ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
-	if (ddc_node) {
-		hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
-		if (!hdmi->ddc)
-			dev_dbg(hdmi->dev, "failed to read ddc node\n");
-	} else {
-		dev_dbg(hdmi->dev, "no ddc property found\n");
-	}
+	if (IS_ENABLED(CONFIG_DRIVER_VIDEO_EDID)) {
+		ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
+		if (ddc_node) {
+			hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
+			if (!hdmi->ddc)
+				dev_dbg(hdmi->dev, "failed to read ddc node\n");
+		} else {
+			dev_dbg(hdmi->dev, "no ddc property found\n");
+		}
 
-	ddc_node = NULL;
+		ddc_node = NULL;
+	}
 
 	hdmi->regs = dev_request_mem_region(dev, 0);
 	if (!hdmi->regs)
-- 
2.1.3


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux