aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spidev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spidev.c')
-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 f5b60c70389b..ddbe1a5e970e 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -30,6 +30,7 @@
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>
33 34
34#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
35#include <linux/spi/spidev.h> 36#include <linux/spi/spidev.h>
@@ -464,6 +465,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
464 struct spidev_data *spidev; 465 struct spidev_data *spidev;
465 int status = -ENXIO; 466 int status = -ENXIO;
466 467
468 lock_kernel();
467 mutex_lock(&device_list_lock); 469 mutex_lock(&device_list_lock);
468 470
469 list_for_each_entry(spidev, &device_list, device_entry) { 471 list_for_each_entry(spidev, &device_list, device_entry) {
@@ -489,6 +491,7 @@ static int spidev_open(struct inode *inode, struct file *filp)
489 pr_debug("spidev: nothing for minor %d\n", iminor(inode)); 491 pr_debug("spidev: nothing for minor %d\n", iminor(inode));
490 492
491 mutex_unlock(&device_list_lock); 493 mutex_unlock(&device_list_lock);
494 unlock_kernel();
492 return status; 495 return status;
493} 496}
494 497