drivers/ioexpander/gpio.c: Return EINVAL if written value is not 0 nor 1.

This commit is contained in:
Valmantas Paliksa 2019-03-22 07:10:57 -06:00 committed by Gregory Nutt
parent 46ba6bd6e3
commit 5bfa7a8df4
1 changed files with 4 additions and 0 deletions

View File

@ -251,6 +251,10 @@ static ssize_t gpio_write(FAR struct file *filep, FAR const char *buffer,
{ {
val = 1; val = 1;
} }
else
{
return -EINVAL;
}
/* Write the GPIO value */ /* Write the GPIO value */