Remove a too strict test and instead, just filter the passed flags with the
supported capabilities. Spotted by: yamori813@yahoo.co.jp (Hiroki Mori) MFC after: 2 weeks
This commit is contained in:
parent
ec0a42e59c
commit
a9a7fbcc58
@ -120,9 +120,9 @@ int
|
||||
gpio_check_flags(uint32_t caps, uint32_t flags)
|
||||
{
|
||||
|
||||
/* Check for unwanted flags. */
|
||||
if ((flags & caps) == 0 || (flags & caps) != flags)
|
||||
return (EINVAL);
|
||||
/* Filter unwanted flags. */
|
||||
flags &= caps;
|
||||
|
||||
/* Cannot mix input/output together. */
|
||||
if (flags & GPIO_PIN_INPUT && flags & GPIO_PIN_OUTPUT)
|
||||
return (EINVAL);
|
||||
|
Loading…
Reference in New Issue
Block a user