From: Marek Vasut Date: Sat, 5 Jan 2019 16:27:39 +0100 Subject: [U-Boot] [PATCH v2 1/1] altera_pio: fix get_value In-Reply-To: <20190105132840.17466-1-julien.beraud@orolia.com> References: <20190105132840.17466-1-julien.beraud@orolia.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On 1/5/19 2:28 PM, Julien B=C3=A9raud wrote: > gpio_get_value should return 0 or 1, not 1 << pin It does not return 1 << pin, it returns value of the bit & (1 << pin). The patch is fine, reword the commit message and add my Acked-by: Marek Vasut Thanks btw you can also align the $subject tags to "gpio: altera_pio: ...". > Signed-off-by: Julien Beraud > --- > drivers/gpio/altera_pio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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, un= signed pin) > struct altera_pio_platdata *plat =3D dev_get_platdata(dev); > struct altera_pio_regs *const regs =3D plat->regs; > =20 > - return readl(®s->data) & (1 << pin); > + return !!(readl(®s->data) & (1 << pin)); > } > =20 > =20 >=20 --=20 Best regards, Marek Vasut