Skip to content
Snippets Groups Projects
Commit bc82a131 authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

gpio: uniphier: use devm_get_addr() to get base address


Currently, fdtdec_get_addr_size() does not support the address
translation, so it cannot handle device trees with non-straight
"ranges" properties.  (This would be a problem with DTS for UniPhier
ARMv8 SoCs.)

Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 336399fb
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <mapmem.h> #include <mapmem.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/sizes.h>
#include <asm/errno.h> #include <asm/errno.h>
#include <asm/gpio.h> #include <asm/gpio.h>
...@@ -91,17 +92,14 @@ static int uniphier_gpio_probe(struct udevice *dev) ...@@ -91,17 +92,14 @@ static int uniphier_gpio_probe(struct udevice *dev)
{ {
struct uniphier_gpio_priv *priv = dev_get_priv(dev); struct uniphier_gpio_priv *priv = dev_get_priv(dev);
struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
DECLARE_GLOBAL_DATA_PTR;
fdt_addr_t addr; fdt_addr_t addr;
fdt_size_t size;
unsigned int tmp; unsigned int tmp;
addr = fdtdec_get_addr_size(gd->fdt_blob, dev->of_offset, "reg", addr = dev_get_addr(dev);
&size);
if (addr == FDT_ADDR_T_NONE) if (addr == FDT_ADDR_T_NONE)
return -EINVAL; return -EINVAL;
priv->base = map_sysmem(addr, size); priv->base = map_sysmem(addr, SZ_8);
if (!priv->base) if (!priv->base)
return -ENOMEM; return -ENOMEM;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment