X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fgpio%2Ftegra186_gpio.c;h=1f0e8d51dadacaf56d752e762a466956e4deb7e7;hb=83d290c56fab2d38cd1ab4c4cc7099559c1d5046;hp=1c681514db9f50e61a9db041ac2067c084db494c;hpb=074a1fdd27953aacb59346c83baaf443335ea04e;p=u-boot diff --git a/drivers/gpio/tegra186_gpio.c b/drivers/gpio/tegra186_gpio.c index 1c681514db..1f0e8d51da 100644 --- a/drivers/gpio/tegra186_gpio.c +++ b/drivers/gpio/tegra186_gpio.c @@ -1,8 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2010-2016, NVIDIA CORPORATION. * (based on tegra_gpio.c) - * - * SPDX-License-Identifier: GPL-2.0 */ #include @@ -17,8 +16,6 @@ #include #include "tegra186_gpio_priv.h" -DECLARE_GLOBAL_DATA_PTR; - struct tegra186_gpio_port_data { const char *name; uint32_t offset; @@ -139,7 +136,7 @@ static int tegra186_gpio_get_function(struct udevice *dev, unsigned offset) } static int tegra186_gpio_xlate(struct udevice *dev, struct gpio_desc *desc, - struct fdtdec_phandle_args *args) + struct ofnode_phandle_args *args) { int gpio, port, ret; @@ -179,9 +176,9 @@ static int tegra186_gpio_bind(struct udevice *parent) if (parent_plat) return 0; - regs = (uint32_t *)dev_get_addr_name(parent, "gpio"); + regs = (uint32_t *)devfdt_get_addr_name(parent, "gpio"); if (regs == (uint32_t *)FDT_ADDR_T_NONE) - return -ENODEV; + return -EINVAL; for (port = 0; port < ctlr_data->port_count; port++) { struct tegra186_gpio_platdata *plat; @@ -197,7 +194,7 @@ static int tegra186_gpio_bind(struct udevice *parent) -1, &dev); if (ret) return ret; - dev->of_offset = parent->of_offset; + dev_set_of_offset(dev, dev_of_offset(parent)); } return 0;