X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fgpio%2Ftegra_gpio.c;h=49655831585689ec3f3d241d346dc5de1979c96e;hb=4d686041895a8fd419bbc3842856239c6298d1f2;hp=b01968a304dae744b5f7926b13f6222868f0e95d;hpb=576a085c1d224b8a5a3ccf5c4114d07a1f695f20;p=oweals%2Fu-boot.git diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c index b01968a304..4965583158 100644 --- a/drivers/gpio/tegra_gpio.c +++ b/drivers/gpio/tegra_gpio.c @@ -236,7 +236,7 @@ static int tegra_gpio_get_function(struct udevice *dev, unsigned offset) } static int tegra_gpio_xlate(struct udevice *dev, struct gpio_desc *desc, - struct fdtdec_phandle_args *args) + struct ofnode_phandle_args *args) { int gpio, port, ret; @@ -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 *)dev_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++) {