]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/char/mem.c
Merge branch 'master' into tk71
[mv-sheeva.git] / drivers / char / mem.c
index 1f528fad3516827754270806a4c6afdee505c9d0..1256454b2d4364f7fa6ad95b661d30ad62b673b4 100644 (file)
@@ -805,6 +805,7 @@ static const struct file_operations full_fops = {
 static const struct file_operations oldmem_fops = {
        .read   = read_oldmem,
        .open   = open_oldmem,
+       .llseek = default_llseek,
 };
 #endif
 
@@ -831,6 +832,7 @@ static ssize_t kmsg_write(struct file *file, const char __user *buf,
 
 static const struct file_operations kmsg_fops = {
        .write = kmsg_write,
+       .llseek = noop_llseek,
 };
 
 static const struct memdev {
@@ -874,6 +876,10 @@ static int memory_open(struct inode *inode, struct file *filp)
        if (dev->dev_info)
                filp->f_mapping->backing_dev_info = dev->dev_info;
 
+       /* Is /dev/mem or /dev/kmem ? */
+       if (dev->dev_info == &directly_mappable_cdev_bdi)
+               filp->f_mode |= FMODE_UNSIGNED_OFFSET;
+
        if (dev->fops->open)
                return dev->fops->open(inode, filp);
 
@@ -882,6 +888,7 @@ static int memory_open(struct inode *inode, struct file *filp)
 
 static const struct file_operations memory_fops = {
        .open = memory_open,
+       .llseek = noop_llseek,
 };
 
 static char *mem_devnode(struct device *dev, mode_t *mode)