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:
Joseph Chen 2020-12-17 17:17:50 +08:00 committed by Jianhong Chen
parent 3bcf0b7c0e
commit e6b2bd8785
1 changed files with 2 additions and 2 deletions

View File

@ -100,7 +100,7 @@ static int __phandle_gpio_to_irq(u32 gpio_phandle, u32 offset)
return EINVAL_GPIO;
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;
break;
}
@ -121,7 +121,7 @@ static int __phandle_gpio_to_irq(u32 gpio_phandle, u32 offset)
/* match alias ? */
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;
break;
}