Skip to content

Commit d9da0b0

Browse files
dcpleunggalak
authored andcommitted
gpio: gpio_sch: fix check for interrupt trigger
The controller does not support trigger. However, the check for this condition was incorrectly (as GPIO_INT_LEVEL is 0). So fix it. Signed-off-by: Daniel Leung <[email protected]>
1 parent d080d1d commit d9da0b0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/gpio/gpio_sch.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ static int gpio_sch_config(struct device *dev,
132132
const struct gpio_sch_config *info = dev->config->config_info;
133133

134134
/* Do some sanity check first */
135-
if (flags & (GPIO_INT | GPIO_INT_LEVEL)) {
136-
/* controller does not support level trigger */
137-
return -EINVAL;
135+
if (flags & GPIO_INT) {
136+
if (!(flags & GPIO_INT_EDGE)) {
137+
/* controller does not support level trigger */
138+
return -EINVAL;
139+
}
138140
}
139141

140142
if (access_op == GPIO_ACCESS_BY_PIN) {

0 commit comments

Comments
 (0)