diff options
author | Simon Glass | 2017-07-25 08:30:03 -0600 |
---|---|---|
committer | Simon Glass | 2017-07-28 12:02:47 -0600 |
commit | 56f5c40ad9c27815ee53eb300128171a46395ade (patch) | |
tree | 0f3de5b1eff63cd8e31baf60f55350a6bd41e69f /drivers/gpio/tegra_gpio.c | |
parent | e93812e81cf07e3179c1b74ba7bf70ecba8f9003 (diff) |
dm: tegra: gpio: Convert to support livetree
Update the GPIO driver to support a live device tree.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Beaver, Jetson-TK1
Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/gpio/tegra_gpio.c')
-rw-r--r-- | drivers/gpio/tegra_gpio.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c index 687cd74fee6..49655831585 100644 --- a/drivers/gpio/tegra_gpio.c +++ b/drivers/gpio/tegra_gpio.c @@ -337,11 +337,13 @@ static int gpio_tegra_bind(struct udevice *parent) * This driver does not make use of interrupts, other than to figure * out the number of GPIO banks */ - if (!fdt_getprop(gd->fdt_blob, dev_of_offset(parent), "interrupts", - &len)) - return -EINVAL; + len = dev_read_size(parent, "interrupts"); + if (len < 0) + return len; bank_count = len / 3 / sizeof(u32); - ctlr = (struct gpio_ctlr *)devfdt_get_addr(parent); + ctlr = (struct gpio_ctlr *)dev_read_addr(parent); + if ((ulong)ctlr == FDT_ADDR_T_NONE) + return -EINVAL; } #endif for (bank = 0; bank < bank_count; bank++) { |