irq: irq-gpio-switch: correct usage of strstr()
Fix gpio interrupt register with wrong gpio bank.
(Fixes: 8db677370c irq: irq-gpio-switch: add gpio alias name support)
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia60e55a134cfab19ed015796486417e0699bd087
This commit is contained in:
parent
3bcf0b7c0e
commit
e6b2bd8785
|
|
@ -100,7 +100,7 @@ static int __phandle_gpio_to_irq(u32 gpio_phandle, u32 offset)
|
||||||
return EINVAL_GPIO;
|
return EINVAL_GPIO;
|
||||||
|
|
||||||
for (bank = 0; bank < GPIO_BANK_NUM; bank++) {
|
for (bank = 0; bank < GPIO_BANK_NUM; bank++) {
|
||||||
if (!strstr(gpio_name, gpio_banks[bank].name)) {
|
if (strstr(gpio_name, gpio_banks[bank].name)) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -121,7 +121,7 @@ static int __phandle_gpio_to_irq(u32 gpio_phandle, u32 offset)
|
||||||
|
|
||||||
/* match alias ? */
|
/* match alias ? */
|
||||||
for (bank = 0; bank < ARRAY_SIZE(gpio_banks); bank++) {
|
for (bank = 0; bank < ARRAY_SIZE(gpio_banks); bank++) {
|
||||||
if (!strstr(gpio_alias[bank], gpio_name)) {
|
if (strstr(gpio_alias[bank], gpio_name)) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue