diff mbox series

[U-Boot] gpio: dwapb_gpio: Change to use dev_read_addr()

Message ID 1534356355-3121-2-git-send-email-ley.foon.tan@intel.com
State Accepted
Commit 9ea354444d156b1f7c1d1990a32215c257b38e16
Delegated to: Marek Vasut
Headers show
Series [U-Boot] gpio: dwapb_gpio: Change to use dev_read_addr() | expand

Commit Message

Ley Foon Tan Aug. 15, 2018, 6:05 p.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Vasut Aug. 15, 2018, 10:11 a.m. UTC | #1
On 08/15/2018 08:05 PM, Ley Foon Tan wrote:
> 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>

Acked-by: Marek Vasut <marex@denx.de>

> ---
>  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;
>
Ley Foon Tan Sept. 4, 2018, 8:14 a.m. UTC | #2
On Wed, Aug 15, 2018 at 6:14 PM Marek Vasut <marex@denx.de> wrote:
>
> On 08/15/2018 08:05 PM, Ley Foon Tan wrote:
> > 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>
>
> Acked-by: Marek Vasut <marex@denx.de>
>
> > ---
> >  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;
> >
>
>
> --
Hi Marek

Do you merge this patch too?

Regards
Ley Foon
Marek Vasut Sept. 4, 2018, 8:31 a.m. UTC | #3
On 08/15/2018 08:05 PM, Ley Foon Tan wrote:
> 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 | 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;
> 
Applied, thanks.
diff mbox series

Patch

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;