Commit 609aaf6a authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Linus Walleij

gpiolib: don't allow OPEN_DRAIN & OPEN_SOURCE flags for input

OPEN_DRAIN and OPEN_SOURCE flags only affect the way we drive a GPIO
line, so they only make sense for output mode. Just as we only allow
input mode for event handle requests, don't allow passing open-drain
and open-source flags for any other mode than explicit output.
Signed-off-by: default avatarBartosz Golaszewski <>
Signed-off-by: default avatarLinus Walleij <>
parent 418ee8e9
......@@ -457,6 +457,12 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)
return -EINVAL;
/* OPEN_DRAIN and OPEN_SOURCE flags only make sense for output mode. */
return -EINVAL;
lh = kzalloc(sizeof(*lh), GFP_KERNEL);
if (!lh)
return -ENOMEM;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment