diff options
Diffstat (limited to 'drivers/pnp/isapnp')
-rw-r--r-- | drivers/pnp/isapnp/Makefile | 6 | ||||
-rw-r--r-- | drivers/pnp/isapnp/proc.c | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/pnp/isapnp/Makefile b/drivers/pnp/isapnp/Makefile index cac18bbfb817..6e607aa33aa3 100644 --- a/drivers/pnp/isapnp/Makefile +++ b/drivers/pnp/isapnp/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Makefile for the kernel ISAPNP driver. | 2 | # Makefile for the kernel ISAPNP driver. |
3 | # | 3 | # |
4 | obj-y += pnp.o | ||
5 | pnp-y := core.o compat.o | ||
4 | 6 | ||
5 | isapnp-proc-$(CONFIG_PROC_FS) = proc.o | 7 | pnp-$(CONFIG_PROC_FS) += proc.o |
6 | |||
7 | obj-y := core.o compat.o $(isapnp-proc-y) | ||
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c index 3f94edab25fa..315b3112aca8 100644 --- a/drivers/pnp/isapnp/proc.c +++ b/drivers/pnp/isapnp/proc.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/isapnp.h> | 21 | #include <linux/isapnp.h> |
22 | #include <linux/proc_fs.h> | 22 | #include <linux/proc_fs.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/smp_lock.h> | ||
25 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
26 | 25 | ||
27 | extern struct pnp_protocol isapnp_protocol; | 26 | extern struct pnp_protocol isapnp_protocol; |
@@ -31,8 +30,9 @@ static struct proc_dir_entry *isapnp_proc_bus_dir = NULL; | |||
31 | static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) | 30 | static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) |
32 | { | 31 | { |
33 | loff_t new = -1; | 32 | loff_t new = -1; |
33 | struct inode *inode = file->f_path.dentry->d_inode; | ||
34 | 34 | ||
35 | lock_kernel(); | 35 | mutex_lock(&inode->i_mutex); |
36 | switch (whence) { | 36 | switch (whence) { |
37 | case 0: | 37 | case 0: |
38 | new = off; | 38 | new = off; |
@@ -44,12 +44,12 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) | |||
44 | new = 256 + off; | 44 | new = 256 + off; |
45 | break; | 45 | break; |
46 | } | 46 | } |
47 | if (new < 0 || new > 256) { | 47 | if (new < 0 || new > 256) |
48 | unlock_kernel(); | 48 | new = -EINVAL; |
49 | return -EINVAL; | 49 | else |
50 | } | 50 | file->f_pos = new; |
51 | unlock_kernel(); | 51 | mutex_unlock(&inode->i_mutex); |
52 | return (file->f_pos = new); | 52 | return new; |
53 | } | 53 | } |
54 | 54 | ||
55 | static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, | 55 | static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, |