public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver
@ 2011-11-22 14:14 Robert Deliën
  2011-11-22 14:21 ` Marek Vasut
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Robert Deliën @ 2011-11-22 14:14 UTC (permalink / raw)
  To: u-boot

This patch fixes a small off-by-one bug in the GPIO driver for the mxs platform that allowed the selection gpio pins of one bank more than the SoC actually has.

Signed-off-by: Robert Deli?n <robert@delien.nl>

diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c
index b7e9591..539738b 100644
--- a/drivers/gpio/mxs_gpio.c
+++ b/drivers/gpio/mxs_gpio.c
@@ -120,7 +120,7 @@ int gpio_direction_output(int gp, int value)
 
 int gpio_request(int gp, const char *label)
 {
-       if (PAD_BANK(gp) > PINCTRL_BANKS)
+       if (PAD_BANK(gp) >= PINCTRL_BANKS)
                return -EINVAL;
 
        return 0;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver
  2011-11-22 14:14 [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver Robert Deliën
@ 2011-11-22 14:21 ` Marek Vasut
  2011-11-22 18:14 ` Marek Vasut
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2011-11-22 14:21 UTC (permalink / raw)
  To: u-boot

> This patch fixes a small off-by-one bug in the GPIO driver for the mxs
> platform that allowed the selection gpio pins of one bank more than the
> SoC actually has.
> 
> Signed-off-by: Robert Deli?n <robert@delien.nl>
> 
> diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c
> index b7e9591..539738b 100644
> --- a/drivers/gpio/mxs_gpio.c
> +++ b/drivers/gpio/mxs_gpio.c
> @@ -120,7 +120,7 @@ int gpio_direction_output(int gp, int value)
> 
>  int gpio_request(int gp, const char *label)
>  {
> -       if (PAD_BANK(gp) > PINCTRL_BANKS)
> +       if (PAD_BANK(gp) >= PINCTRL_BANKS)
>                 return -EINVAL;
> 
>         return 0;

Good catch, I'll verify and ack afterwards.

Thanks

M

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver
  2011-11-22 14:14 [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver Robert Deliën
  2011-11-22 14:21 ` Marek Vasut
@ 2011-11-22 18:14 ` Marek Vasut
       [not found] ` <201111221953.42597.marek.vasut@gmail.com>
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2011-11-22 18:14 UTC (permalink / raw)
  To: u-boot

> This patch fixes a small off-by-one bug in the GPIO driver for the mxs
> platform that allowed the selection gpio pins of one bank more than the
> SoC actually has.
> 
> Signed-off-by: Robert Deli?n <robert@delien.nl>
> 
> diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c
> index b7e9591..539738b 100644
> --- a/drivers/gpio/mxs_gpio.c
> +++ b/drivers/gpio/mxs_gpio.c
> @@ -120,7 +120,7 @@ int gpio_direction_output(int gp, int value)
> 
>  int gpio_request(int gp, const char *label)
>  {
> -       if (PAD_BANK(gp) > PINCTRL_BANKS)
> +       if (PAD_BANK(gp) >= PINCTRL_BANKS)
>                 return -EINVAL;
> 
>         return 0;

Acked-by: Marek Vasut <marek.vasut@gmail.com>

I'd like to see Stefano review this too.

M

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver
       [not found]   ` <0691ADAF-BBB6-4B35-A26B-BDAF622ED9D2@delien.nl>
@ 2011-11-22 22:35     ` Marek Vasut
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2011-11-22 22:35 UTC (permalink / raw)
  To: u-boot

> > Sure, I wrote the code, I know what it does and where you see the
> > problem. It's just to be dead sure. Anyway, I acked it so it means I
> > agree with the change.
> 
> Of course. Thanks. Hence my elaboration, to make your checks easier.

Please, ALWAYS Cc the mailing list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver
  2011-11-22 14:14 [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver Robert Deliën
                   ` (2 preceding siblings ...)
       [not found] ` <201111221953.42597.marek.vasut@gmail.com>
@ 2011-11-22 22:49 ` Marek Vasut
  2011-11-25  8:14 ` Stefano Babic
  4 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2011-11-22 22:49 UTC (permalink / raw)
  To: u-boot

> This patch fixes a small off-by-one bug in the GPIO driver for the mxs
> platform that allowed the selection gpio pins of one bank more than the
> SoC actually has.
> 
> Signed-off-by: Robert Deli?n <robert@delien.nl>
> 
> diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c
> index b7e9591..539738b 100644
> --- a/drivers/gpio/mxs_gpio.c
> +++ b/drivers/gpio/mxs_gpio.c
> @@ -120,7 +120,7 @@ int gpio_direction_output(int gp, int value)
> 
>  int gpio_request(int gp, const char *label)
>  {
> -       if (PAD_BANK(gp) > PINCTRL_BANKS)
> +       if (PAD_BANK(gp) >= PINCTRL_BANKS)
>                 return -EINVAL;
> 
>         return 0;

Stefano, can you please apply ?

Acked-by: Marek Vasut <marek.vasut@gmail.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver
  2011-11-22 14:14 [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver Robert Deliën
                   ` (3 preceding siblings ...)
  2011-11-22 22:49 ` Marek Vasut
@ 2011-11-25  8:14 ` Stefano Babic
  4 siblings, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2011-11-25  8:14 UTC (permalink / raw)
  To: u-boot

On 22/11/2011 15:14, Robert Deli?n wrote:
> This patch fixes a small off-by-one bug in the GPIO driver for the mxs platform that allowed the selection gpio pins of one bank more than the SoC actually has.
> 
> Signed-off-by: Robert Deli?n <robert@delien.nl>
> 
> diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c
> index b7e9591..539738b 100644
> --- a/drivers/gpio/mxs_gpio.c
> +++ b/drivers/gpio/mxs_gpio.c
> @@ -120,7 +120,7 @@ int gpio_direction_output(int gp, int value)
>  
>  int gpio_request(int gp, const char *label)
>  {
> -       if (PAD_BANK(gp) > PINCTRL_BANKS)
> +       if (PAD_BANK(gp) >= PINCTRL_BANKS)
>                 return -EINVAL;
>  
>         return 0;
> 

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-25  8:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22 14:14 [U-Boot] [PATCH] M28: Fix OB1 bug in GPIO driver Robert Deliën
2011-11-22 14:21 ` Marek Vasut
2011-11-22 18:14 ` Marek Vasut
     [not found] ` <201111221953.42597.marek.vasut@gmail.com>
     [not found]   ` <0691ADAF-BBB6-4B35-A26B-BDAF622ED9D2@delien.nl>
2011-11-22 22:35     ` Marek Vasut
2011-11-22 22:49 ` Marek Vasut
2011-11-25  8:14 ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox