|
@@ -13,7 +13,6 @@
|
|
#include <linux/fcntl.h>
|
|
#include <linux/fcntl.h>
|
|
#include <linux/nvram.h>
|
|
#include <linux/nvram.h>
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
-#include <linux/smp_lock.h>
|
|
|
|
#include <asm/uaccess.h>
|
|
#include <asm/uaccess.h>
|
|
#include <asm/nvram.h>
|
|
#include <asm/nvram.h>
|
|
|
|
|
|
@@ -21,7 +20,6 @@
|
|
|
|
|
|
static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
|
|
static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
|
|
{
|
|
{
|
|
- lock_kernel();
|
|
|
|
switch (origin) {
|
|
switch (origin) {
|
|
case 1:
|
|
case 1:
|
|
offset += file->f_pos;
|
|
offset += file->f_pos;
|
|
@@ -30,12 +28,10 @@ static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
|
|
offset += NVRAM_SIZE;
|
|
offset += NVRAM_SIZE;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- if (offset < 0) {
|
|
|
|
- unlock_kernel();
|
|
|
|
|
|
+ if (offset < 0)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
- }
|
|
|
|
|
|
+
|
|
file->f_pos = offset;
|
|
file->f_pos = offset;
|
|
- unlock_kernel();
|
|
|
|
return file->f_pos;
|
|
return file->f_pos;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -76,8 +72,7 @@ static ssize_t write_nvram(struct file *file, const char __user *buf,
|
|
return p - buf;
|
|
return p - buf;
|
|
}
|
|
}
|
|
|
|
|
|
-static int nvram_ioctl(struct inode *inode, struct file *file,
|
|
|
|
- unsigned int cmd, unsigned long arg)
|
|
|
|
|
|
+static long nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|
{
|
|
{
|
|
switch(cmd) {
|
|
switch(cmd) {
|
|
case PMAC_NVRAM_GET_OFFSET:
|
|
case PMAC_NVRAM_GET_OFFSET:
|