diff mbox series

[U-Boot,v3,1/1] gpio: altera_pio: fix get_value

Message ID 20190107091733.6870-1-julien.beraud@orolia.com
State Deferred
Delegated to: Marek Vasut
Headers show
Series [U-Boot,v3,1/1] gpio: altera_pio: fix get_value | expand

Commit Message

Julien Beraud Jan. 7, 2019, 9:17 a.m. UTC
gpio_get_value should return 0 or 1, not the value of bit & (1 << pin)

Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Julien Beraud <julien.beraud@orolia.com>
---
 drivers/gpio/altera_pio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Vasut Jan. 7, 2019, 9:26 a.m. UTC | #1
On 1/7/19 10:17 AM, Julien Béraud wrote:
> gpio_get_value should return 0 or 1, not the value of bit & (1 << pin)
> 
> Acked-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Julien Beraud <julien.beraud@orolia.com>

btw. you should keep a changelog with each new Vx of a patch.
Here it's fine, just add one next time you submit patches.

> ---
>  drivers/gpio/altera_pio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/altera_pio.c b/drivers/gpio/altera_pio.c
> index 59e30979f0..324f9c29a8 100644
> --- a/drivers/gpio/altera_pio.c
> +++ b/drivers/gpio/altera_pio.c
> @@ -56,7 +56,7 @@ static int altera_pio_get_value(struct udevice *dev, unsigned pin)
>  	struct altera_pio_platdata *plat = dev_get_platdata(dev);
>  	struct altera_pio_regs *const regs = plat->regs;
>  
> -	return readl(&regs->data) & (1 << pin);
> +	return !!(readl(&regs->data) & (1 << pin));
>  }
>  
>  
>
Julien Beraud Jan. 7, 2019, 9:27 a.m. UTC | #2
On 07/01/2019 10:26, Marek Vasut wrote:

> btw. you should keep a changelog with each new Vx of a patch.
> Here it's fine, just add one next time you submit patches.
Sure, I'll do it next time. Thanks.

Julien
Julien Beraud Feb. 20, 2019, 3:13 p.m. UTC | #3
On 07/01/2019 10:27, Julien Beraud wrote:
> 
> On 07/01/2019 10:26, Marek Vasut wrote:
> 
>> btw. you should keep a changelog with each new Vx of a patch.
>> Here it's fine, just add one next time you submit patches.
> Sure, I'll do it next time. Thanks.
> 
> Julien

Hi Marek,

I can see on https://patchwork.ozlabs.org/patch/1021221/ that the patch 
has been delegated to you. Though I assume you were thinking someone 
else would apply, may I ask you to apply it ?

Regards,
Julien
Marek Vasut Feb. 20, 2019, 3:17 p.m. UTC | #4
On 2/20/19 4:13 PM, Julien Béraud wrote:
> 
> On 07/01/2019 10:27, Julien Beraud wrote:
>>
>> On 07/01/2019 10:26, Marek Vasut wrote:
>>
>>> btw. you should keep a changelog with each new Vx of a patch.
>>> Here it's fine, just add one next time you submit patches.
>> Sure, I'll do it next time. Thanks.
>>
>> Julien
> 
> Hi Marek,
> 
> I can see on https://patchwork.ozlabs.org/patch/1021221/ that the patch 
> has been delegated to you. Though I assume you were thinking someone 
> else would apply, may I ask you to apply it ?

Applied, thanks for the reminder
diff mbox series

Patch

diff --git a/drivers/gpio/altera_pio.c b/drivers/gpio/altera_pio.c
index 59e30979f0..324f9c29a8 100644
--- a/drivers/gpio/altera_pio.c
+++ b/drivers/gpio/altera_pio.c
@@ -56,7 +56,7 @@  static int altera_pio_get_value(struct udevice *dev, unsigned pin)
 	struct altera_pio_platdata *plat = dev_get_platdata(dev);
 	struct altera_pio_regs *const regs = plat->regs;
 
-	return readl(&regs->data) & (1 << pin);
+	return !!(readl(&regs->data) & (1 << pin));
 }