Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100266
b: refs/heads/master
c: 1fa984b
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Corbet committed May 18, 2008
1 parent 7314a7e commit 717c259
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 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: 7558da942e51933b5e6aa5e851d4da1df0cd6752
refs/heads/master: 1fa984b583a809423ddb1d88fa46484071f85f80
10 changes: 7 additions & 3 deletions trunk/arch/sh/boards/landisk/gio.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/kdev_t.h>
#include <linux/cdev.h>
#include <linux/fs.h>
Expand All @@ -32,17 +33,20 @@ static int openCnt;
static int gio_open(struct inode *inode, struct file *filp)
{
int minor;
int ret = -ENOENT;

lock_kernel();
minor = MINOR(inode->i_rdev);
if (minor < DEVCOUNT) {
if (openCnt > 0) {
return -EALREADY;
ret = -EALREADY;
} else {
openCnt++;
return 0;
ret = 0;
}
}
return -ENOENT;
unlock_kernel();
return ret;
}

static int gio_close(struct inode *inode, struct file *filp)
Expand Down

0 comments on commit 717c259

Please sign in to comment.