add userspace tool for gpio_dev

SVN-Revision: 10267
This commit is contained in:
John Crispin
2008-01-26 04:24:05 +00:00
parent d7b86662f7
commit 8f39c35159
4 changed files with 145 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ gpio_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned
{
int retval = 0;
if ((arg & gpio_access_mask) != arg)
if (((1 << arg) & gpio_access_mask) != (1 << arg))
{
retval = -EINVAL;
goto out;
@@ -57,7 +57,7 @@ gpio_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned
break;
case GPIO_SET:
gpio_set_value(arg, 0);
gpio_set_value(arg, 1);
break;
case GPIO_CLEAR: