aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/drivers/mach-a3/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/arch-v32/drivers/mach-a3/gpio.c')
-rw-r--r--arch/cris/arch-v32/drivers/mach-a3/gpio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/cris/arch-v32/drivers/mach-a3/gpio.c b/arch/cris/arch-v32/drivers/mach-a3/gpio.c
index de107dad9f4f..ef98608e5067 100644
--- a/arch/cris/arch-v32/drivers/mach-a3/gpio.c
+++ b/arch/cris/arch-v32/drivers/mach-a3/gpio.c
@@ -23,6 +23,7 @@
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26#include <linux/smp_lock.h>
26 27
27#include <asm/etraxgpio.h> 28#include <asm/etraxgpio.h>
28#include <hwregs/reg_map.h> 29#include <hwregs/reg_map.h>
@@ -390,6 +391,8 @@ static int gpio_open(struct inode *inode, struct file *filp)
390 391
391 if (!priv) 392 if (!priv)
392 return -ENOMEM; 393 return -ENOMEM;
394
395 lock_kernel();
393 memset(priv, 0, sizeof(*priv)); 396 memset(priv, 0, sizeof(*priv));
394 397
395 priv->minor = p; 398 priv->minor = p;
@@ -412,6 +415,7 @@ static int gpio_open(struct inode *inode, struct file *filp)
412 spin_unlock_irq(&gpio_lock); 415 spin_unlock_irq(&gpio_lock);
413 } 416 }
414 417
418 unlock_kernel();
415 return 0; 419 return 0;
416} 420}
417 421