From: Peng Fan Date: Mon, 25 May 2026 04:06:01 +0000 (+0800) Subject: gpio: nx: Use dev_remap_addr() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc988983d25b19cedd76cba1903e321c52198801;p=thirdparty%2Fu-boot.git gpio: nx: Use dev_remap_addr() Use dev_remap_addr() to simplify code. dev_remap_addr() does same thing as dev_read_addr() + map_physmem(). And it supports both live device tree and flat DT backends, avoiding direct dependency on devfdt_* helpers. Also add error handling logic. No functional changes. Signed-off-by: Peng Fan --- diff --git a/drivers/gpio/nx_gpio.c b/drivers/gpio/nx_gpio.c index 5abbb34daea..1c3d27eb1cc 100644 --- a/drivers/gpio/nx_gpio.c +++ b/drivers/gpio/nx_gpio.c @@ -213,9 +213,10 @@ static int nx_gpio_of_to_plat(struct udevice *dev) { struct nx_gpio_plat *plat = dev_get_plat(dev); - plat->regs = map_physmem(devfdt_get_addr(dev), - sizeof(struct nx_gpio_regs), - MAP_NOCACHE); + plat->regs = dev_remap_addr(dev); + if (!plat->regs) + return -EINVAL; + plat->gpio_count = dev_read_s32_default(dev, "nexell,gpio-bank-width", 32); plat->bank_name = dev_read_string(dev, "gpio-bank-name");