Skip to contentSkip to conversation

gpio: omap: Pass correct argument to _get_gpio_direction()

PATCH New Axel Lin 2 participants 3 messages Jan 31, 2015 – Feb 6, 2015 GPIO

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 gpio: omap: Pass correct argument to _get_gpio_direction()

Pass bank rather than bank->base to _get_gpio_direction().

---
 drivers/gpio/omap_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/omap_gpio.c +1 -1
index f3a7ccb..19fc451 100644
@@ -291,7 +291,7 @@ static int omap_gpio_get_function(struct udevice *dev, unsigned offset)
 	struct gpio_bank *bank = dev_get_priv(dev);
 
 	/* GPIOF_FUNC is not implemented yet */
-	if (_get_gpio_direction(bank->base, offset) == OMAP_GPIO_DIR_OUT)
+	if (_get_gpio_direction(bank, offset) == OMAP_GPIO_DIR_OUT)
 		return GPIOF_OUTPUT;
 	else
 		return GPIOF_INPUT;
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 gpio: omap: Pass correct argument to _get_gpio_direction()

HI Axel,

Quoted 12 lines · Axel Lin

Pass bank rather than bank->base to _get_gpio_direction().

---
 drivers/gpio/omap_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/omap_gpio.c +0 -0
index f3a7ccb..19fc451 100644

drivers/gpio/omap_gpio.c static int omap_gpio_get_function(struct udevice *dev, unsigned offset) · line 297

Quoted 8 lines
drivers/gpio/omap_gpio.c +1 -1
@@ -291,7 +291,7 @@ static int omap_gpio_get_function(struct udevice *dev, unsigned offset)
        struct gpio_bank *bank = dev_get_priv(dev);
 
        /* GPIOF_FUNC is not implemented yet */
-       if (_get_gpio_direction(bank->base, offset) == OMAP_GPIO_DIR_OUT)
+       if (_get_gpio_direction(bank, offset) == OMAP_GPIO_DIR_OUT)
                return GPIOF_OUTPUT;
        else
                return GPIOF_INPUT;

Ah yes another reason why we need a struct rather than void * in struct gpio_bank.

Thanks for the patch, will pick up for u-boot-dm.

Regards,
Simon

#2 lore raw

PATCH 1/1 gpio: omap: Pass correct argument to _get_gpio_direction()

Quoted 27 lines · Simon Glass

HI Axel,

Quoted 12 lines · Axel Lin

Pass bank rather than bank->base to _get_gpio_direction().

---
 drivers/gpio/omap_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/omap_gpio.c +0 -0
index f3a7ccb..19fc451 100644

drivers/gpio/omap_gpio.c static int omap_gpio_get_function(struct udevice *dev, unsigned offset) · line 297

Quoted 8 lines
drivers/gpio/omap_gpio.c +1 -1
@@ -291,7 +291,7 @@ static int omap_gpio_get_function(struct udevice *dev, unsigned offset)
        struct gpio_bank *bank = dev_get_priv(dev);
 
        /* GPIOF_FUNC is not implemented yet */
-       if (_get_gpio_direction(bank->base, offset) == OMAP_GPIO_DIR_OUT)
+       if (_get_gpio_direction(bank, offset) == OMAP_GPIO_DIR_OUT)
                return GPIOF_OUTPUT;
        else
                return GPIOF_INPUT;

Ah yes another reason why we need a struct rather than void * in struct gpio_bank.

Quoted 3 lines

Thanks for the patch, will pick up for u-boot-dm.

Applied to u-boot-dm, thanks!