add userspace tool for gpio_dev

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10267 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
John Crispin
2008-01-26 04:24:05 +00:00
parent 40bd451c88
commit b6ed86f4c2
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: