diff mbox series

[edk2,2/2] ArmPlatformPkg/PL061Gpio: fix the offset value in Get function

Message ID 1486972380-24255-2-git-send-email-haojian.zhuang@linaro.org
State Accepted
Commit d176bb3c5c28e0c89ae86995ecd6b9e21b4e0b9f
Headers show
Series [edk2,1/2] ArmPlatformPkg/PL061: remove duplicated PL061_GPIO_DATA_REG | expand

Commit Message

Haojian Zhuang Feb. 13, 2017, 7:53 a.m. UTC
When call PL061GetPins() or PL061SetPins(), should use GPIO_PIN_MASK(offset)
as parameter, not offset.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>

---
 ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Haojian Zhuang Feb. 13, 2017, 12:59 p.m. UTC | #1
On 13 February 2017 at 15:53, Haojian Zhuang <haojian.zhuang@linaro.org> wrote:
> When call PL061GetPins() or PL061SetPins(), should use GPIO_PIN_MASK(offset)

> as parameter, not offset.

>

> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>

> ---

>  ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c

> index ff8bb3b..81b9f6d 100644

> --- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c

> +++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c

> @@ -186,7 +186,7 @@ Get (

>      return EFI_INVALID_PARAMETER;

>    }

>

> -  if (PL061GetPins (RegisterBase, Offset)) {

> +  if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset))) {

>      *Value = 1;

>    } else {

>      *Value = 0;

> --

> 2.7.4

>


Correct Ard's email address.

Regards
Haojian
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Feb. 16, 2017, 11:34 a.m. UTC | #2
On 13 February 2017 at 07:53, Haojian Zhuang <haojian.zhuang@linaro.org> wrote:
> When call PL061GetPins() or PL061SetPins(), should use GPIO_PIN_MASK(offset)

> as parameter, not offset.

>

> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>


Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>


Pushed as

d164a0e31bf8 ArmPlatformPkg/PL061: remove duplicated PL061_GPIO_DATA_REG
d176bb3c5c28 ArmPlatformPkg/PL061Gpio: fix the offset value in Get function

> ---

>  ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c

> index ff8bb3b..81b9f6d 100644

> --- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c

> +++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c

> @@ -186,7 +186,7 @@ Get (

>      return EFI_INVALID_PARAMETER;

>    }

>

> -  if (PL061GetPins (RegisterBase, Offset)) {

> +  if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset))) {

>      *Value = 1;

>    } else {

>      *Value = 0;

> --

> 2.7.4

>

> _______________________________________________

> edk2-devel mailing list

> edk2-devel@lists.01.org

> https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
index ff8bb3b..81b9f6d 100644
--- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
+++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
@@ -186,7 +186,7 @@  Get (
     return EFI_INVALID_PARAMETER;
   }
 
-  if (PL061GetPins (RegisterBase, Offset)) {
+  if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset))) {
     *Value = 1;
   } else {
     *Value = 0;