[U-Boot] [PATCH v2 19/31] dm: tegra: i2c: Convert to livetree

Simon Glass sjg at chromium.org
Sat Jun 3 03:04:14 UTC 2017


Update the tegra i2c driver to support a live device tree.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v2: None

 drivers/i2c/tegra_i2c.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c
index 055f48153a..4163d798d5 100644
--- a/drivers/i2c/tegra_i2c.c
+++ b/drivers/i2c/tegra_i2c.c
@@ -365,7 +365,11 @@ static int tegra_i2c_probe(struct udevice *dev)
 
 	i2c_bus->id = dev->seq;
 	i2c_bus->type = dev_get_driver_data(dev);
-	i2c_bus->regs = (struct i2c_ctlr *)devfdt_get_addr(dev);
+	i2c_bus->regs = (struct i2c_ctlr *)dev_read_addr(dev);
+	if ((ulong)i2c_bus->regs == FDT_ADDR_T_NONE) {
+		debug("%s: Cannot get regs address\n", __func__);
+		return -EINVAL;
+	}
 
 	ret = reset_get_by_name(dev, "i2c", &i2c_bus->reset_ctl);
 	if (ret) {
-- 
2.13.0.506.g27d5fe0cd-goog



More information about the U-Boot mailing list