Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73719
b: refs/heads/master
c: 5c6ff79
h: refs/heads/master
i:
  73717: b5e32cb
  73715: 0217108
  73711: 0b1b4d8
v: v3
  • Loading branch information
Roel Kluin authored and Linus Torvalds committed Nov 15, 2007
1 parent 47d145b commit 34569bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5d0360ee96a5ef953dbea45873c2a8c87e77d59b
refs/heads/master: 5c6ff79d0908df0d281c05b5b693eaba55b06e0f
15 changes: 11 additions & 4 deletions trunk/arch/cris/arch-v10/drivers/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,10 @@ gpio_poll(struct file *file,
data = *R_PORT_PB_DATA;
else if (priv->minor == GPIO_MINOR_G)
data = *R_PORT_G_DATA;
else
else {
spin_unlock(&gpio_lock);
return 0;
}

if ((data & priv->highalarm) ||
(~data & priv->lowalarm)) {
Expand Down Expand Up @@ -381,18 +383,21 @@ static ssize_t gpio_write(struct file * file, const char * buf, size_t count,

ssize_t retval = count;
if (priv->minor !=GPIO_MINOR_A && priv->minor != GPIO_MINOR_B) {
return -EFAULT;
retval = -EFAULT;
goto out;
}

if (!access_ok(VERIFY_READ, buf, count)) {
return -EFAULT;
retval = -EFAULT;
goto out;
}
clk_mask = priv->clk_mask;
data_mask = priv->data_mask;
/* It must have been configured using the IO_CFG_WRITE_MODE */
/* Perhaps a better error code? */
if (clk_mask == 0 || data_mask == 0) {
return -EPERM;
retval = -EPERM;
goto out;
}
write_msb = priv->write_msb;
D(printk("gpio_write: %lu to data 0x%02X clk 0x%02X msb: %i\n",count, data_mask, clk_mask, write_msb));
Expand Down Expand Up @@ -425,6 +430,7 @@ static ssize_t gpio_write(struct file * file, const char * buf, size_t count,
}
}
}
out:
spin_unlock(&gpio_lock);
return retval;
}
Expand Down Expand Up @@ -506,6 +512,7 @@ gpio_release(struct inode *inode, struct file *filp)
while (p) {
if (p->highalarm | p->lowalarm) {
gpio_some_alarms = 1;
spin_unlock(&gpio_lock);
return 0;
}
p = p->next;
Expand Down

0 comments on commit 34569bb

Please sign in to comment.