X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=arch%2Fum%2Fdrivers%2Fharddog_kern.c;fp=arch%2Fum%2Fdrivers%2Fharddog_kern.c;h=2d0266d0254d5eef5477a7da2d5e9ea36378ca46;hb=f2ec334db8d14ae3ec2e4bf8d974f75b8f772e26;hp=cfcac1ff4cf20276d19ee8fb137dfc84a6cf8abb;hpb=81e20d4d8d0317ecf1c7d193a52ab26cf74e1737;p=mv-sheeva.git diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c index cfcac1ff4cf..2d0266d0254 100644 --- a/arch/um/drivers/harddog_kern.c +++ b/arch/um/drivers/harddog_kern.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -50,6 +50,7 @@ MODULE_LICENSE("GPL"); +static DEFINE_MUTEX(harddog_mutex); static DEFINE_SPINLOCK(lock); static int timer_alive; static int harddog_in_fd = -1; @@ -66,7 +67,7 @@ static int harddog_open(struct inode *inode, struct file *file) int err = -EBUSY; char *sock = NULL; - lock_kernel(); + mutex_lock(&harddog_mutex); spin_lock(&lock); if(timer_alive) goto err; @@ -83,11 +84,11 @@ static int harddog_open(struct inode *inode, struct file *file) timer_alive = 1; spin_unlock(&lock); - unlock_kernel(); + mutex_unlock(&harddog_mutex); return nonseekable_open(inode, file); err: spin_unlock(&lock); - unlock_kernel(); + mutex_unlock(&harddog_mutex); return err; } @@ -153,9 +154,9 @@ static long harddog_ioctl(struct file *file, { long ret; - lock_kernel(); + mutex_lock(&harddog_mutex); ret = harddog_ioctl_unlocked(file, cmd, arg); - unlock_kernel(); + mutex_unlock(&harddog_mutex); return ret; } @@ -166,6 +167,7 @@ static const struct file_operations harddog_fops = { .unlocked_ioctl = harddog_ioctl, .open = harddog_open, .release = harddog_release, + .llseek = no_llseek, }; static struct miscdevice harddog_miscdev = {