diff options
-rw-r--r-- | drivers/gpio/gpio-virtuser.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-virtuser.c b/drivers/gpio/gpio-virtuser.c index 2ac09c6a3763..0e0d55da4f01 100644 --- a/drivers/gpio/gpio-virtuser.c +++ b/drivers/gpio/gpio-virtuser.c @@ -406,12 +406,12 @@ static ssize_t gpio_virtuser_direction_do_write(struct file *file, trimmed = strim(buf); - if (strcmp(buf, "input") == 0) { + if (strcmp(trimmed, "input") == 0) { dir = 1; - } else if (strcmp(buf, "output-high") == 0) { + } else if (strcmp(trimmed, "output-high") == 0) { dir = 0; val = 1; - } else if (strcmp(buf, "output-low") == 0) { + } else if (strcmp(trimmed, "output-low") == 0) { dir = val = 0; } else { return -EINVAL; |