From: Simon Glass Date: Tue, 25 Jul 2017 14:30:06 +0000 (-0600) Subject: dm: tegra: i2c: Convert to livetree X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=d8554d0853ec975f298e349fce27933c335062ea;p=u-boot.git dm: tegra: i2c: Convert to livetree Update the tegra i2c driver to support a live device tree. Signed-off-by: Simon Glass Tested-by: Marcel Ziswiler Tested-on: Beaver, Jetson-TK1 Tested-by: Stephen Warren --- diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c index 055f48153a..3255e8ed37 100644 --- a/drivers/i2c/tegra_i2c.c +++ b/drivers/i2c/tegra_i2c.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -365,7 +364,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) {