aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spidev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index b3518ca9f04e..ab2b769c83ca 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -29,6 +29,7 @@
29#include <linux/errno.h> 29#include <linux/errno.h>
30#include <linux/mutex.h> 30#include <linux/mutex.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/smp_lock.h>
32 33
33#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
34#include <linux/spi/spidev.h> 35#include <linux/spi/spidev.h>
@@ -393,6 +394,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
393 struct spidev_data *spidev; 394 struct spidev_data *spidev;
394 int status = -ENXIO; 395 int status = -ENXIO;
395 396
397 lock_kernel();
396 mutex_lock(&device_list_lock); 398 mutex_lock(&device_list_lock);
397 399
398 list_for_each_entry(spidev, &device_list, device_entry) { 400 list_for_each_entry(spidev, &device_list, device_entry) {
@@ -418,6 +420,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
418 pr_debug("spidev: nothing for minor %d\n", iminor(inode)); 420 pr_debug("spidev: nothing for minor %d\n", iminor(inode));
419 421
420 mutex_unlock(&device_list_lock); 422 mutex_unlock(&device_list_lock);
423 unlock_kernel();
421 return status; 424 return status;
422} 425}
423 426