]> err.no Git - linux-2.6/commitdiff
spidev: BKL pushdown
authorJonathan Corbet <corbet@lwn.net>
Fri, 16 May 2008 19:46:14 +0000 (13:46 -0600)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:50 +0000 (14:05 -0600)
Add the BKL to spidev_open(), even though the existing locking looks
adequate.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
drivers/spi/spidev.c

index b3518ca9f04e01b0d3115908988f9e4ccd8d2aed..ab2b769c83ca94096c2a09fd550558db96caf533 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/errno.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
+#include <linux/smp_lock.h>
 
 #include <linux/spi/spi.h>
 #include <linux/spi/spidev.h>
@@ -393,6 +394,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
        struct spidev_data      *spidev;
        int                     status = -ENXIO;
 
+       lock_kernel();
        mutex_lock(&device_list_lock);
 
        list_for_each_entry(spidev, &device_list, device_entry) {
@@ -418,6 +420,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
                pr_debug("spidev: nothing for minor %d\n", iminor(inode));
 
        mutex_unlock(&device_list_lock);
+       unlock_kernel();
        return status;
 }