aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 11:07:38 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 11:07:38 -0500
commit18821b0408efc92ec2804128ba9382a3bcebf132 (patch)
treef98fbf75e8e8f33965e489879505fb621e2f11bb /drivers
parent3b8ecd22447c4266500c0bcf97f035310543e494 (diff)
parent55e858c8483af427144f33b42b818b30612b82b0 (diff)
Merge branch 'bkl-drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'bkl-drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: agp: Remove the BKL from agp_open inifiband: Remove BKL from ipath_open() mips: Remove BKL from tb0219 drivers: Remove BKL from scx200_gpio drivers: Remove BKL from pc8736x_gpio parisc: Remove BKL from eisa_eeprom rtc: Remove BKL from efirtc input: Remove BKL from hp_sdc_rtc hw_random: Remove BKL from core macintosh: Remove BKL from ans-lcd nvram: Drop the bkl from non-generic nvram_llseek() nvram: Drop the bkl from nvram_llseek() mem_class: Drop the bkl from memory_open() spi: Remove BKL from spidev_open drivers: Remove BKL from cs5535_gpio drivers: Remove BKL from misc_open
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/agp/frontend.c28
-rw-r--r--drivers/char/cs5535_gpio.c3
-rw-r--r--drivers/char/efirtc.c12
-rw-r--r--drivers/char/generic_nvram.c9
-rw-r--r--drivers/char/hw_random/core.c1
-rw-r--r--drivers/char/mem.c17
-rw-r--r--drivers/char/misc.c5
-rw-r--r--drivers/char/nvram.c4
-rw-r--r--drivers/char/pc8736x_gpio.c2
-rw-r--r--drivers/char/scx200_gpio.c2
-rw-r--r--drivers/char/tb0219.c6
-rw-r--r--drivers/infiniband/hw/ipath/ipath_file_ops.c1
-rw-r--r--drivers/input/misc/hp_sdc_rtc.c2
-rw-r--r--drivers/macintosh/ans-lcd.c45
-rw-r--r--drivers/parisc/eisa_eeprom.c10
-rw-r--r--drivers/spi/spidev.c3
16 files changed, 52 insertions, 98 deletions
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c
index a96f3197e60f..43412c03969e 100644
--- a/drivers/char/agp/frontend.c
+++ b/drivers/char/agp/frontend.c
@@ -676,25 +676,25 @@ static int agp_open(struct inode *inode, struct file *file)
676 int minor = iminor(inode); 676 int minor = iminor(inode);
677 struct agp_file_private *priv; 677 struct agp_file_private *priv;
678 struct agp_client *client; 678 struct agp_client *client;
679 int rc = -ENXIO;
680
681 lock_kernel();
682 mutex_lock(&(agp_fe.agp_mutex));
683 679
684 if (minor != AGPGART_MINOR) 680 if (minor != AGPGART_MINOR)
685 goto err_out; 681 return -ENXIO;
682
683 mutex_lock(&(agp_fe.agp_mutex));
686 684
687 priv = kzalloc(sizeof(struct agp_file_private), GFP_KERNEL); 685 priv = kzalloc(sizeof(struct agp_file_private), GFP_KERNEL);
688 if (priv == NULL) 686 if (priv == NULL) {
689 goto err_out_nomem; 687 mutex_unlock(&(agp_fe.agp_mutex));
688 return -ENOMEM;
689 }
690 690
691 set_bit(AGP_FF_ALLOW_CLIENT, &priv->access_flags); 691 set_bit(AGP_FF_ALLOW_CLIENT, &priv->access_flags);
692 priv->my_pid = current->pid; 692 priv->my_pid = current->pid;
693 693
694 if (capable(CAP_SYS_RAWIO)) { 694 if (capable(CAP_SYS_RAWIO))
695 /* Root priv, can be controller */ 695 /* Root priv, can be controller */
696 set_bit(AGP_FF_ALLOW_CONTROLLER, &priv->access_flags); 696 set_bit(AGP_FF_ALLOW_CONTROLLER, &priv->access_flags);
697 } 697
698 client = agp_find_client_by_pid(current->pid); 698 client = agp_find_client_by_pid(current->pid);
699 699
700 if (client != NULL) { 700 if (client != NULL) {
@@ -704,16 +704,10 @@ static int agp_open(struct inode *inode, struct file *file)
704 file->private_data = (void *) priv; 704 file->private_data = (void *) priv;
705 agp_insert_file_private(priv); 705 agp_insert_file_private(priv);
706 DBG("private=%p, client=%p", priv, client); 706 DBG("private=%p, client=%p", priv, client);
707 mutex_unlock(&(agp_fe.agp_mutex));
708 unlock_kernel();
709 return 0;
710 707
711err_out_nomem:
712 rc = -ENOMEM;
713err_out:
714 mutex_unlock(&(agp_fe.agp_mutex)); 708 mutex_unlock(&(agp_fe.agp_mutex));
715 unlock_kernel(); 709
716 return rc; 710 return 0;
717} 711}
718 712
719 713
diff --git a/drivers/char/cs5535_gpio.c b/drivers/char/cs5535_gpio.c
index 04ba906b4880..4d830dc482ef 100644
--- a/drivers/char/cs5535_gpio.c
+++ b/drivers/char/cs5535_gpio.c
@@ -17,7 +17,7 @@
17#include <linux/cdev.h> 17#include <linux/cdev.h>
18#include <linux/ioport.h> 18#include <linux/ioport.h>
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/smp_lock.h> 20
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/io.h> 22#include <asm/io.h>
23 23
@@ -158,7 +158,6 @@ static int cs5535_gpio_open(struct inode *inode, struct file *file)
158{ 158{
159 u32 m = iminor(inode); 159 u32 m = iminor(inode);
160 160
161 cycle_kernel_lock();
162 /* the mask says which pins are usable by this driver */ 161 /* the mask says which pins are usable by this driver */
163 if ((mask & (1 << m)) == 0) 162 if ((mask & (1 << m)) == 0)
164 return -EINVAL; 163 return -EINVAL;
diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c
index 34d15d548236..26a47dc88f61 100644
--- a/drivers/char/efirtc.c
+++ b/drivers/char/efirtc.c
@@ -27,8 +27,6 @@
27 * - Add module support 27 * - Add module support
28 */ 28 */
29 29
30
31#include <linux/smp_lock.h>
32#include <linux/types.h> 30#include <linux/types.h>
33#include <linux/errno.h> 31#include <linux/errno.h>
34#include <linux/miscdevice.h> 32#include <linux/miscdevice.h>
@@ -174,13 +172,12 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
174 return -EINVAL; 172 return -EINVAL;
175 173
176 case RTC_RD_TIME: 174 case RTC_RD_TIME:
177 lock_kernel();
178 spin_lock_irqsave(&efi_rtc_lock, flags); 175 spin_lock_irqsave(&efi_rtc_lock, flags);
179 176
180 status = efi.get_time(&eft, &cap); 177 status = efi.get_time(&eft, &cap);
181 178
182 spin_unlock_irqrestore(&efi_rtc_lock,flags); 179 spin_unlock_irqrestore(&efi_rtc_lock,flags);
183 unlock_kernel(); 180
184 if (status != EFI_SUCCESS) { 181 if (status != EFI_SUCCESS) {
185 /* should never happen */ 182 /* should never happen */
186 printk(KERN_ERR "efitime: can't read time\n"); 183 printk(KERN_ERR "efitime: can't read time\n");
@@ -202,13 +199,11 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
202 199
203 convert_to_efi_time(&wtime, &eft); 200 convert_to_efi_time(&wtime, &eft);
204 201
205 lock_kernel();
206 spin_lock_irqsave(&efi_rtc_lock, flags); 202 spin_lock_irqsave(&efi_rtc_lock, flags);
207 203
208 status = efi.set_time(&eft); 204 status = efi.set_time(&eft);
209 205
210 spin_unlock_irqrestore(&efi_rtc_lock,flags); 206 spin_unlock_irqrestore(&efi_rtc_lock,flags);
211 unlock_kernel();
212 207
213 return status == EFI_SUCCESS ? 0 : -EINVAL; 208 return status == EFI_SUCCESS ? 0 : -EINVAL;
214 209
@@ -224,7 +219,6 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
224 219
225 convert_to_efi_time(&wtime, &eft); 220 convert_to_efi_time(&wtime, &eft);
226 221
227 lock_kernel();
228 spin_lock_irqsave(&efi_rtc_lock, flags); 222 spin_lock_irqsave(&efi_rtc_lock, flags);
229 /* 223 /*
230 * XXX Fixme: 224 * XXX Fixme:
@@ -235,19 +229,16 @@ static long efi_rtc_ioctl(struct file *file, unsigned int cmd,
235 status = efi.set_wakeup_time((efi_bool_t)enabled, &eft); 229 status = efi.set_wakeup_time((efi_bool_t)enabled, &eft);
236 230
237 spin_unlock_irqrestore(&efi_rtc_lock,flags); 231 spin_unlock_irqrestore(&efi_rtc_lock,flags);
238 unlock_kernel();
239 232
240 return status == EFI_SUCCESS ? 0 : -EINVAL; 233 return status == EFI_SUCCESS ? 0 : -EINVAL;
241 234
242 case RTC_WKALM_RD: 235 case RTC_WKALM_RD:
243 236
244 lock_kernel();
245 spin_lock_irqsave(&efi_rtc_lock, flags); 237 spin_lock_irqsave(&efi_rtc_lock, flags);
246 238
247 status = efi.get_wakeup_time((efi_bool_t *)&enabled, (efi_bool_t *)&pending, &eft); 239 status = efi.get_wakeup_time((efi_bool_t *)&enabled, (efi_bool_t *)&pending, &eft);
248 240
249 spin_unlock_irqrestore(&efi_rtc_lock,flags); 241 spin_unlock_irqrestore(&efi_rtc_lock,flags);
250 unlock_kernel();
251 242
252 if (status != EFI_SUCCESS) return -EINVAL; 243 if (status != EFI_SUCCESS) return -EINVAL;
253 244
@@ -277,7 +268,6 @@ static int efi_rtc_open(struct inode *inode, struct file *file)
277 * We do accept multiple open files at the same time as we 268 * We do accept multiple open files at the same time as we
278 * synchronize on the per call operation. 269 * synchronize on the per call operation.
279 */ 270 */
280 cycle_kernel_lock();
281 return 0; 271 return 0;
282} 272}
283 273
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c
index ef31738c2cbe..fda4181b5e67 100644
--- a/drivers/char/generic_nvram.c
+++ b/drivers/char/generic_nvram.c
@@ -19,7 +19,6 @@
19#include <linux/miscdevice.h> 19#include <linux/miscdevice.h>
20#include <linux/fcntl.h> 20#include <linux/fcntl.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/smp_lock.h>
23#include <asm/uaccess.h> 22#include <asm/uaccess.h>
24#include <asm/nvram.h> 23#include <asm/nvram.h>
25#ifdef CONFIG_PPC_PMAC 24#ifdef CONFIG_PPC_PMAC
@@ -32,7 +31,6 @@ static ssize_t nvram_len;
32 31
33static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) 32static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
34{ 33{
35 lock_kernel();
36 switch (origin) { 34 switch (origin) {
37 case 1: 35 case 1:
38 offset += file->f_pos; 36 offset += file->f_pos;
@@ -41,12 +39,11 @@ static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
41 offset += nvram_len; 39 offset += nvram_len;
42 break; 40 break;
43 } 41 }
44 if (offset < 0) { 42 if (offset < 0)
45 unlock_kernel();
46 return -EINVAL; 43 return -EINVAL;
47 } 44
48 file->f_pos = offset; 45 file->f_pos = offset;
49 unlock_kernel(); 46
50 return file->f_pos; 47 return file->f_pos;
51} 48}
52 49
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index 8b7d56a0fe3a..e989f67bb61f 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -76,7 +76,6 @@ static int rng_dev_open(struct inode *inode, struct file *filp)
76 return -EINVAL; 76 return -EINVAL;
77 if (filp->f_mode & FMODE_WRITE) 77 if (filp->f_mode & FMODE_WRITE)
78 return -EINVAL; 78 return -EINVAL;
79 cycle_kernel_lock();
80 return 0; 79 return 0;
81} 80}
82 81
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index a074fceb67d3..ad82ec92ebd4 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -26,7 +26,6 @@
26#include <linux/bootmem.h> 26#include <linux/bootmem.h>
27#include <linux/splice.h> 27#include <linux/splice.h>
28#include <linux/pfn.h> 28#include <linux/pfn.h>
29#include <linux/smp_lock.h>
30 29
31#include <asm/uaccess.h> 30#include <asm/uaccess.h>
32#include <asm/io.h> 31#include <asm/io.h>
@@ -892,29 +891,23 @@ static int memory_open(struct inode *inode, struct file *filp)
892{ 891{
893 int minor; 892 int minor;
894 const struct memdev *dev; 893 const struct memdev *dev;
895 int ret = -ENXIO;
896
897 lock_kernel();
898 894
899 minor = iminor(inode); 895 minor = iminor(inode);
900 if (minor >= ARRAY_SIZE(devlist)) 896 if (minor >= ARRAY_SIZE(devlist))
901 goto out; 897 return -ENXIO;
902 898
903 dev = &devlist[minor]; 899 dev = &devlist[minor];
904 if (!dev->fops) 900 if (!dev->fops)
905 goto out; 901 return -ENXIO;
906 902
907 filp->f_op = dev->fops; 903 filp->f_op = dev->fops;
908 if (dev->dev_info) 904 if (dev->dev_info)
909 filp->f_mapping->backing_dev_info = dev->dev_info; 905 filp->f_mapping->backing_dev_info = dev->dev_info;
910 906
911 if (dev->fops->open) 907 if (dev->fops->open)
912 ret = dev->fops->open(inode, filp); 908 return dev->fops->open(inode, filp);
913 else 909
914 ret = 0; 910 return 0;
915out:
916 unlock_kernel();
917 return ret;
918} 911}
919 912
920static const struct file_operations memory_fops = { 913static const struct file_operations memory_fops = {
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 07fa612a58d5..96f1cd086dd2 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -49,7 +49,6 @@
49#include <linux/device.h> 49#include <linux/device.h>
50#include <linux/tty.h> 50#include <linux/tty.h>
51#include <linux/kmod.h> 51#include <linux/kmod.h>
52#include <linux/smp_lock.h>
53 52
54/* 53/*
55 * Head entry for the doubly linked miscdevice list 54 * Head entry for the doubly linked miscdevice list
@@ -118,8 +117,7 @@ static int misc_open(struct inode * inode, struct file * file)
118 struct miscdevice *c; 117 struct miscdevice *c;
119 int err = -ENODEV; 118 int err = -ENODEV;
120 const struct file_operations *old_fops, *new_fops = NULL; 119 const struct file_operations *old_fops, *new_fops = NULL;
121 120
122 lock_kernel();
123 mutex_lock(&misc_mtx); 121 mutex_lock(&misc_mtx);
124 122
125 list_for_each_entry(c, &misc_list, list) { 123 list_for_each_entry(c, &misc_list, list) {
@@ -157,7 +155,6 @@ static int misc_open(struct inode * inode, struct file * file)
157 fops_put(old_fops); 155 fops_put(old_fops);
158fail: 156fail:
159 mutex_unlock(&misc_mtx); 157 mutex_unlock(&misc_mtx);
160 unlock_kernel();
161 return err; 158 return err;
162} 159}
163 160
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 88cee4099be9..2100a8f7bd86 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -38,7 +38,6 @@
38#define NVRAM_VERSION "1.3" 38#define NVRAM_VERSION "1.3"
39 39
40#include <linux/module.h> 40#include <linux/module.h>
41#include <linux/smp_lock.h>
42#include <linux/nvram.h> 41#include <linux/nvram.h>
43 42
44#define PC 1 43#define PC 1
@@ -214,7 +213,6 @@ void nvram_set_checksum(void)
214 213
215static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) 214static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
216{ 215{
217 lock_kernel();
218 switch (origin) { 216 switch (origin) {
219 case 0: 217 case 0:
220 /* nothing to do */ 218 /* nothing to do */
@@ -226,7 +224,7 @@ static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
226 offset += NVRAM_BYTES; 224 offset += NVRAM_BYTES;
227 break; 225 break;
228 } 226 }
229 unlock_kernel(); 227
230 return (offset >= 0) ? (file->f_pos = offset) : -EINVAL; 228 return (offset >= 0) ? (file->f_pos = offset) : -EINVAL;
231} 229}
232 230
diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c
index 3f7da8cf3a80..8ecbcc174c15 100644
--- a/drivers/char/pc8736x_gpio.c
+++ b/drivers/char/pc8736x_gpio.c
@@ -20,7 +20,6 @@
20#include <linux/mutex.h> 20#include <linux/mutex.h>
21#include <linux/nsc_gpio.h> 21#include <linux/nsc_gpio.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/smp_lock.h>
24#include <asm/uaccess.h> 23#include <asm/uaccess.h>
25 24
26#define DEVNAME "pc8736x_gpio" 25#define DEVNAME "pc8736x_gpio"
@@ -223,7 +222,6 @@ static int pc8736x_gpio_open(struct inode *inode, struct file *file)
223 unsigned m = iminor(inode); 222 unsigned m = iminor(inode);
224 file->private_data = &pc8736x_gpio_ops; 223 file->private_data = &pc8736x_gpio_ops;
225 224
226 cycle_kernel_lock();
227 dev_dbg(&pdev->dev, "open %d\n", m); 225 dev_dbg(&pdev->dev, "open %d\n", m);
228 226
229 if (m >= PC8736X_GPIO_CT) 227 if (m >= PC8736X_GPIO_CT)
diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c
index 1d9100561c8a..99e5272e3c53 100644
--- a/drivers/char/scx200_gpio.c
+++ b/drivers/char/scx200_gpio.c
@@ -12,7 +12,6 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/smp_lock.h>
16#include <asm/uaccess.h> 15#include <asm/uaccess.h>
17#include <asm/io.h> 16#include <asm/io.h>
18 17
@@ -52,7 +51,6 @@ static int scx200_gpio_open(struct inode *inode, struct file *file)
52 unsigned m = iminor(inode); 51 unsigned m = iminor(inode);
53 file->private_data = &scx200_gpio_ops; 52 file->private_data = &scx200_gpio_ops;
54 53
55 cycle_kernel_lock();
56 if (m >= MAX_PINS) 54 if (m >= MAX_PINS)
57 return -EINVAL; 55 return -EINVAL;
58 return nonseekable_open(inode, file); 56 return nonseekable_open(inode, file);
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c
index b3ec9b10e292..cad4eb65f13d 100644
--- a/drivers/char/tb0219.c
+++ b/drivers/char/tb0219.c
@@ -21,7 +21,6 @@
21#include <linux/fs.h> 21#include <linux/fs.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/smp_lock.h>
25 24
26#include <asm/io.h> 25#include <asm/io.h>
27#include <asm/reboot.h> 26#include <asm/reboot.h>
@@ -38,7 +37,7 @@ MODULE_PARM_DESC(major, "Major device number");
38 37
39static void (*old_machine_restart)(char *command); 38static void (*old_machine_restart)(char *command);
40static void __iomem *tb0219_base; 39static void __iomem *tb0219_base;
41static spinlock_t tb0219_lock; 40static DEFINE_SPINLOCK(tb0219_lock);
42 41
43#define tb0219_read(offset) readw(tb0219_base + (offset)) 42#define tb0219_read(offset) readw(tb0219_base + (offset))
44#define tb0219_write(offset, value) writew((value), tb0219_base + (offset)) 43#define tb0219_write(offset, value) writew((value), tb0219_base + (offset))
@@ -237,7 +236,6 @@ static int tanbac_tb0219_open(struct inode *inode, struct file *file)
237{ 236{
238 unsigned int minor; 237 unsigned int minor;
239 238
240 cycle_kernel_lock();
241 minor = iminor(inode); 239 minor = iminor(inode);
242 switch (minor) { 240 switch (minor) {
243 case 0: 241 case 0:
@@ -306,8 +304,6 @@ static int __devinit tb0219_probe(struct platform_device *dev)
306 return retval; 304 return retval;
307 } 305 }
308 306
309 spin_lock_init(&tb0219_lock);
310
311 old_machine_restart = _machine_restart; 307 old_machine_restart = _machine_restart;
312 _machine_restart = tb0219_restart; 308 _machine_restart = tb0219_restart;
313 309
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index 40dbe54056c7..73933a41ce84 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -1821,7 +1821,6 @@ done:
1821static int ipath_open(struct inode *in, struct file *fp) 1821static int ipath_open(struct inode *in, struct file *fp)
1822{ 1822{
1823 /* The real work is performed later in ipath_assign_port() */ 1823 /* The real work is performed later in ipath_assign_port() */
1824 cycle_kernel_lock();
1825 fp->private_data = kzalloc(sizeof(struct ipath_filedata), GFP_KERNEL); 1824 fp->private_data = kzalloc(sizeof(struct ipath_filedata), GFP_KERNEL);
1826 return fp->private_data ? 0 : -ENOMEM; 1825 return fp->private_data ? 0 : -ENOMEM;
1827} 1826}
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
index ea821b546969..ad730e15afc0 100644
--- a/drivers/input/misc/hp_sdc_rtc.c
+++ b/drivers/input/misc/hp_sdc_rtc.c
@@ -35,7 +35,6 @@
35 35
36#include <linux/hp_sdc.h> 36#include <linux/hp_sdc.h>
37#include <linux/errno.h> 37#include <linux/errno.h>
38#include <linux/smp_lock.h>
39#include <linux/types.h> 38#include <linux/types.h>
40#include <linux/init.h> 39#include <linux/init.h>
41#include <linux/module.h> 40#include <linux/module.h>
@@ -409,7 +408,6 @@ static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait)
409 408
410static int hp_sdc_rtc_open(struct inode *inode, struct file *file) 409static int hp_sdc_rtc_open(struct inode *inode, struct file *file)
411{ 410{
412 cycle_kernel_lock();
413 return 0; 411 return 0;
414} 412}
415 413
diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c
index 6a8221893256..a3d25da2f275 100644
--- a/drivers/macintosh/ans-lcd.c
+++ b/drivers/macintosh/ans-lcd.c
@@ -3,7 +3,6 @@
3 */ 3 */
4 4
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/smp_lock.h>
7#include <linux/errno.h> 6#include <linux/errno.h>
8#include <linux/kernel.h> 7#include <linux/kernel.h>
9#include <linux/miscdevice.h> 8#include <linux/miscdevice.h>
@@ -26,6 +25,7 @@
26static unsigned long anslcd_short_delay = 80; 25static unsigned long anslcd_short_delay = 80;
27static unsigned long anslcd_long_delay = 3280; 26static unsigned long anslcd_long_delay = 3280;
28static volatile unsigned char __iomem *anslcd_ptr; 27static volatile unsigned char __iomem *anslcd_ptr;
28static DEFINE_MUTEX(anslcd_mutex);
29 29
30#undef DEBUG 30#undef DEBUG
31 31
@@ -65,26 +65,31 @@ anslcd_write( struct file * file, const char __user * buf,
65 65
66 if (!access_ok(VERIFY_READ, buf, count)) 66 if (!access_ok(VERIFY_READ, buf, count))
67 return -EFAULT; 67 return -EFAULT;
68
69 mutex_lock(&anslcd_mutex);
68 for ( i = *ppos; count > 0; ++i, ++p, --count ) 70 for ( i = *ppos; count > 0; ++i, ++p, --count )
69 { 71 {
70 char c; 72 char c;
71 __get_user(c, p); 73 __get_user(c, p);
72 anslcd_write_byte_data( c ); 74 anslcd_write_byte_data( c );
73 } 75 }
76 mutex_unlock(&anslcd_mutex);
74 *ppos = i; 77 *ppos = i;
75 return p - buf; 78 return p - buf;
76} 79}
77 80
78static int 81static long
79anslcd_ioctl( struct inode * inode, struct file * file, 82anslcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
80 unsigned int cmd, unsigned long arg )
81{ 83{
82 char ch, __user *temp; 84 char ch, __user *temp;
85 long ret = 0;
83 86
84#ifdef DEBUG 87#ifdef DEBUG
85 printk(KERN_DEBUG "LCD: ioctl(%d,%d)\n",cmd,arg); 88 printk(KERN_DEBUG "LCD: ioctl(%d,%d)\n",cmd,arg);
86#endif 89#endif
87 90
91 mutex_lock(&anslcd_mutex);
92
88 switch ( cmd ) 93 switch ( cmd )
89 { 94 {
90 case ANSLCD_CLEAR: 95 case ANSLCD_CLEAR:
@@ -93,7 +98,7 @@ anslcd_ioctl( struct inode * inode, struct file * file,
93 anslcd_write_byte_ctrl ( 0x06 ); 98 anslcd_write_byte_ctrl ( 0x06 );
94 anslcd_write_byte_ctrl ( 0x01 ); 99 anslcd_write_byte_ctrl ( 0x01 );
95 anslcd_write_byte_ctrl ( 0x02 ); 100 anslcd_write_byte_ctrl ( 0x02 );
96 return 0; 101 break;
97 case ANSLCD_SENDCTRL: 102 case ANSLCD_SENDCTRL:
98 temp = (char __user *) arg; 103 temp = (char __user *) arg;
99 __get_user(ch, temp); 104 __get_user(ch, temp);
@@ -101,33 +106,37 @@ anslcd_ioctl( struct inode * inode, struct file * file,
101 anslcd_write_byte_ctrl ( ch ); 106 anslcd_write_byte_ctrl ( ch );
102 __get_user(ch, temp); 107 __get_user(ch, temp);
103 } 108 }
104 return 0; 109 break;
105 case ANSLCD_SETSHORTDELAY: 110 case ANSLCD_SETSHORTDELAY:
106 if (!capable(CAP_SYS_ADMIN)) 111 if (!capable(CAP_SYS_ADMIN))
107 return -EACCES; 112 ret =-EACCES;
108 anslcd_short_delay=arg; 113 else
109 return 0; 114 anslcd_short_delay=arg;
115 break;
110 case ANSLCD_SETLONGDELAY: 116 case ANSLCD_SETLONGDELAY:
111 if (!capable(CAP_SYS_ADMIN)) 117 if (!capable(CAP_SYS_ADMIN))
112 return -EACCES; 118 ret = -EACCES;
113 anslcd_long_delay=arg; 119 else
114 return 0; 120 anslcd_long_delay=arg;
121 break;
115 default: 122 default:
116 return -EINVAL; 123 ret = -EINVAL;
117 } 124 }
125
126 mutex_unlock(&anslcd_mutex);
127 return ret;
118} 128}
119 129
120static int 130static int
121anslcd_open( struct inode * inode, struct file * file ) 131anslcd_open( struct inode * inode, struct file * file )
122{ 132{
123 cycle_kernel_lock();
124 return 0; 133 return 0;
125} 134}
126 135
127const struct file_operations anslcd_fops = { 136const struct file_operations anslcd_fops = {
128 .write = anslcd_write, 137 .write = anslcd_write,
129 .ioctl = anslcd_ioctl, 138 .unlocked_ioctl = anslcd_ioctl,
130 .open = anslcd_open, 139 .open = anslcd_open,
131}; 140};
132 141
133static struct miscdevice anslcd_dev = { 142static struct miscdevice anslcd_dev = {
@@ -168,6 +177,7 @@ anslcd_init(void)
168 printk(KERN_DEBUG "LCD: init\n"); 177 printk(KERN_DEBUG "LCD: init\n");
169#endif 178#endif
170 179
180 mutex_lock(&anslcd_mutex);
171 anslcd_write_byte_ctrl ( 0x38 ); 181 anslcd_write_byte_ctrl ( 0x38 );
172 anslcd_write_byte_ctrl ( 0x0c ); 182 anslcd_write_byte_ctrl ( 0x0c );
173 anslcd_write_byte_ctrl ( 0x06 ); 183 anslcd_write_byte_ctrl ( 0x06 );
@@ -176,6 +186,7 @@ anslcd_init(void)
176 for(a=0;a<80;a++) { 186 for(a=0;a<80;a++) {
177 anslcd_write_byte_data(anslcd_logo[a]); 187 anslcd_write_byte_data(anslcd_logo[a]);
178 } 188 }
189 mutex_unlock(&anslcd_mutex);
179 return 0; 190 return 0;
180} 191}
181 192
diff --git a/drivers/parisc/eisa_eeprom.c b/drivers/parisc/eisa_eeprom.c
index 8c0b26e9b98a..cce00ed81f37 100644
--- a/drivers/parisc/eisa_eeprom.c
+++ b/drivers/parisc/eisa_eeprom.c
@@ -75,17 +75,8 @@ static ssize_t eisa_eeprom_read(struct file * file,
75 return ret; 75 return ret;
76} 76}
77 77
78static int eisa_eeprom_ioctl(struct inode *inode, struct file *file,
79 unsigned int cmd,
80 unsigned long arg)
81{
82 return -ENOTTY;
83}
84
85static int eisa_eeprom_open(struct inode *inode, struct file *file) 78static int eisa_eeprom_open(struct inode *inode, struct file *file)
86{ 79{
87 cycle_kernel_lock();
88
89 if (file->f_mode & FMODE_WRITE) 80 if (file->f_mode & FMODE_WRITE)
90 return -EINVAL; 81 return -EINVAL;
91 82
@@ -104,7 +95,6 @@ static const struct file_operations eisa_eeprom_fops = {
104 .owner = THIS_MODULE, 95 .owner = THIS_MODULE,
105 .llseek = eisa_eeprom_llseek, 96 .llseek = eisa_eeprom_llseek,
106 .read = eisa_eeprom_read, 97 .read = eisa_eeprom_read,
107 .ioctl = eisa_eeprom_ioctl,
108 .open = eisa_eeprom_open, 98 .open = eisa_eeprom_open,
109 .release = eisa_eeprom_release, 99 .release = eisa_eeprom_release,
110}; 100};
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 5d23983f02fc..815a65012cbf 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -30,7 +30,6 @@
30#include <linux/errno.h> 30#include <linux/errno.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/smp_lock.h>
34 33
35#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
36#include <linux/spi/spidev.h> 35#include <linux/spi/spidev.h>
@@ -477,7 +476,6 @@ static int spidev_open(struct inode *inode, struct file *filp)
477 struct spidev_data *spidev; 476 struct spidev_data *spidev;
478 int status = -ENXIO; 477 int status = -ENXIO;
479 478
480 lock_kernel();
481 mutex_lock(&device_list_lock); 479 mutex_lock(&device_list_lock);
482 480
483 list_for_each_entry(spidev, &device_list, device_entry) { 481 list_for_each_entry(spidev, &device_list, device_entry) {
@@ -503,7 +501,6 @@ static int spidev_open(struct inode *inode, struct file *filp)
503 pr_debug("spidev: nothing for minor %d\n", iminor(inode)); 501 pr_debug("spidev: nothing for minor %d\n", iminor(inode));
504 502
505 mutex_unlock(&device_list_lock); 503 mutex_unlock(&device_list_lock);
506 unlock_kernel();
507 return status; 504 return status;
508} 505}
509 506