From: Ley Foon Tan Date: Thu, 16 Aug 2018 02:05:54 +0800 Subject: [U-Boot] [PATCH] gpio: dwapb_gpio: Change to use dev_read_addr() In-Reply-To: <1534356355-3121-1-git-send-email-ley.foon.tan@intel.com> References: <1534356355-3121-1-git-send-email-ley.foon.tan@intel.com> Message-ID: <1534356355-3121-2-git-send-email-ley.foon.tan@intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This changes the driver to use dev_read_addr() which is safe both for flat trees and live trees. Signed-off-by: Ley Foon Tan --- drivers/gpio/dwapb_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index a118f58..680b11a 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -111,7 +111,7 @@ static int gpio_dwapb_bind(struct udevice *dev) if (plat) return 0; - base = fdtdec_get_addr(blob, dev_of_offset(dev), "reg"); + base = dev_read_addr(dev); if (base == FDT_ADDR_T_NONE) { debug("Can't get the GPIO register base address\n"); return -ENXIO; -- 2.2.2