aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/generic_nvram.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/generic_nvram.c')
-rw-r--r--drivers/char/generic_nvram.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c
index fda4181b5e67..82b5a88a82d7 100644
--- a/drivers/char/generic_nvram.c
+++ b/drivers/char/generic_nvram.c
@@ -19,6 +19,7 @@
19#include <linux/miscdevice.h> 19#include <linux/miscdevice.h>
20#include <linux/fcntl.h> 20#include <linux/fcntl.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/smp_lock.h>
22#include <asm/uaccess.h> 23#include <asm/uaccess.h>
23#include <asm/nvram.h> 24#include <asm/nvram.h>
24#ifdef CONFIG_PPC_PMAC 25#ifdef CONFIG_PPC_PMAC
@@ -84,8 +85,7 @@ static ssize_t write_nvram(struct file *file, const char __user *buf,
84 return p - buf; 85 return p - buf;
85} 86}
86 87
87static int nvram_ioctl(struct inode *inode, struct file *file, 88static int nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
88 unsigned int cmd, unsigned long arg)
89{ 89{
90 switch(cmd) { 90 switch(cmd) {
91#ifdef CONFIG_PPC_PMAC 91#ifdef CONFIG_PPC_PMAC
@@ -116,12 +116,23 @@ static int nvram_ioctl(struct inode *inode, struct file *file,
116 return 0; 116 return 0;
117} 117}
118 118
119static long nvram_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
120{
121 int ret;
122
123 lock_kernel();
124 ret = nvram_ioctl(file, cmd, arg);
125 unlock_kernel();
126
127 return ret;
128}
129
119const struct file_operations nvram_fops = { 130const struct file_operations nvram_fops = {
120 .owner = THIS_MODULE, 131 .owner = THIS_MODULE,
121 .llseek = nvram_llseek, 132 .llseek = nvram_llseek,
122 .read = read_nvram, 133 .read = read_nvram,
123 .write = write_nvram, 134 .write = write_nvram,
124 .ioctl = nvram_ioctl, 135 .unlocked_ioctl = nvram_unlocked_ioctl,
125}; 136};
126 137
127static struct miscdevice nvram_dev = { 138static struct miscdevice nvram_dev = {