]> git.baikalelectronics.ru Git - uboot.git/commitdiff
gpio: dwapb_gpio: Change to use dev_read_addr()
authorLey Foon Tan <ley.foon.tan@intel.com>
Wed, 15 Aug 2018 18:05:54 +0000 (02:05 +0800)
committerMarek Vasut <marex@denx.de>
Sat, 15 Sep 2018 01:17:01 +0000 (03:17 +0200)
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 <ley.foon.tan@intel.com>
drivers/gpio/dwapb_gpio.c

index 3f6f2e875a38ec62ef2ed4bf5fe8289f2039425e..0f6574d5da1554e436efc6b9edd6e27ae4d910b4 100644 (file)
@@ -159,7 +159,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;