From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] gpio: bcm6345: convert to use live dt
Date: Sat, 17 Mar 2018 12:24:59 +0100 [thread overview]
Message-ID: <20180317112459.9558-1-noltari@gmail.com> (raw)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
drivers/gpio/bcm6345_gpio.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/gpio/bcm6345_gpio.c b/drivers/gpio/bcm6345_gpio.c
index b9100cdc58..92541f6002 100644
--- a/drivers/gpio/bcm6345_gpio.c
+++ b/drivers/gpio/bcm6345_gpio.c
@@ -14,8 +14,6 @@
#include <asm/gpio.h>
#include <asm/io.h>
-DECLARE_GLOBAL_DATA_PTR;
-
struct bcm6345_gpio_priv {
void __iomem *reg_dirout;
void __iomem *reg_data;
@@ -92,21 +90,19 @@ static int bcm6345_gpio_probe(struct udevice *dev)
struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
struct bcm6345_gpio_priv *priv = dev_get_priv(dev);
fdt_addr_t data_addr, dirout_addr;
- fdt_size_t data_size, dirout_size;
- dirout_addr = devfdt_get_addr_size_index(dev, 0, &dirout_size);
+ dirout_addr = dev_read_addr_index(dev, 0);
if (dirout_addr == FDT_ADDR_T_NONE)
return -EINVAL;
- data_addr = devfdt_get_addr_size_index(dev, 1, &data_size);
+ data_addr = dev_read_addr_index(dev, 1);
if (data_addr == FDT_ADDR_T_NONE)
return -EINVAL;
- priv->reg_data = ioremap(data_addr, data_size);
- priv->reg_dirout = ioremap(dirout_addr, dirout_size);
+ priv->reg_data = ioremap(data_addr, 0);
+ priv->reg_dirout = ioremap(dirout_addr, 0);
- uc_priv->gpio_count = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev),
- "ngpios", 32);
+ uc_priv->gpio_count = dev_read_u32_default(dev, "ngpios", 32);
uc_priv->bank_name = dev->name;
return 0;
--
2.11.0
next reply other threads:[~2018-03-17 11:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-17 11:24 Álvaro Fernández Rojas [this message]
2018-03-19 17:59 ` [U-Boot] [PATCH] gpio: bcm6345: convert to use live dt Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180317112459.9558-1-noltari@gmail.com \
--to=noltari@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.