diff options
Diffstat (limited to 'arch/cris/arch-v32/drivers/mach-fs/gpio.c')
-rw-r--r-- | arch/cris/arch-v32/drivers/mach-fs/gpio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c index 7863fd4efc2b..fe1fde893887 100644 --- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
25 | #include <linux/smp_lock.h> | ||
25 | 26 | ||
26 | #include <asm/etraxgpio.h> | 27 | #include <asm/etraxgpio.h> |
27 | #include <hwregs/reg_map.h> | 28 | #include <hwregs/reg_map.h> |
@@ -426,9 +427,10 @@ gpio_open(struct inode *inode, struct file *filp) | |||
426 | return -EINVAL; | 427 | return -EINVAL; |
427 | 428 | ||
428 | priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL); | 429 | priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL); |
429 | |||
430 | if (!priv) | 430 | if (!priv) |
431 | return -ENOMEM; | 431 | return -ENOMEM; |
432 | |||
433 | lock_kernel(); | ||
432 | memset(priv, 0, sizeof(*priv)); | 434 | memset(priv, 0, sizeof(*priv)); |
433 | 435 | ||
434 | priv->minor = p; | 436 | priv->minor = p; |
@@ -449,6 +451,7 @@ gpio_open(struct inode *inode, struct file *filp) | |||
449 | alarmlist = priv; | 451 | alarmlist = priv; |
450 | spin_unlock_irq(&alarm_lock); | 452 | spin_unlock_irq(&alarm_lock); |
451 | 453 | ||
454 | unlock_kernel(); | ||
452 | return 0; | 455 | return 0; |
453 | } | 456 | } |
454 | 457 | ||