mirror of
https://github.com/apache/nuttx.git
synced 2026-05-19 20:06:24 +08:00
drivers/ioexpander/gpio.c: Return EINVAL if written value is not 0 nor 1.
This commit is contained in:
committed by
Gregory Nutt
parent
46ba6bd6e3
commit
5bfa7a8df4
@@ -251,6 +251,10 @@ static ssize_t gpio_write(FAR struct file *filep, FAR const char *buffer,
|
||||
{
|
||||
val = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Write the GPIO value */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user