projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
963649d
)
platform-drivers-x86: intel_pmic_gpio: Fix off-by-one valid offset range check
author
Axel Lin
<
[email protected]
>
Tue, 15 Apr 2014 02:54:11 +0000
(10:54 +0800)
committer
Matthew Garrett
<
[email protected]
>
Mon, 9 Jun 2014 21:39:58 +0000
(17:39 -0400)
Only pin 0-7 support input, so the valid offset range should be 0 ~ 7.
Signed-off-by: Axel Lin <
[email protected]
>
Signed-off-by: Matthew Garrett <
[email protected]
>
drivers/platform/x86/intel_pmic_gpio.c
patch
|
blob
|
history
diff --git
a/drivers/platform/x86/intel_pmic_gpio.c
b/drivers/platform/x86/intel_pmic_gpio.c
index 2805988485f6c9cba19ef99afd51e9b1723acbb0..40929e4f7ad73f407bada0062d3fd8e8bb5debe5 100644
(file)
--- a/
drivers/platform/x86/intel_pmic_gpio.c
+++ b/
drivers/platform/x86/intel_pmic_gpio.c
@@
-91,7
+91,7
@@
static void pmic_program_irqtype(int gpio, int type)
static int pmic_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
{
- if (offset > 8) {
+ if (offset >
=
8) {
pr_err("only pin 0-7 support input\n");
return -1;/* we only have 8 GPIO can use as input */
}
@@
-130,7
+130,7
@@
static int pmic_gpio_get(struct gpio_chip *chip, unsigned offset)
int ret;
/* we only have 8 GPIO pins we can use as input */
- if (offset > 8)
+ if (offset >
=
8)
return -EOPNOTSUPP;
ret = intel_scu_ipc_ioread8(GPIO0 + offset, &r);
if (ret < 0)