X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fchar%2Fmem.c;h=cc9a9d0df979f5dcf69b4e70d4f7945aae68a490;hb=4f911d64e04a44c47985be30f978fb3c2efcee0c;hp=f5c160caf9f480978db2cb0698192268433370ae;hpb=e45521a8d44da2c4efd17fc8e853f7917e99b57a;p=linux-2.6-omap-h63xx.git diff --git a/drivers/char/mem.c b/drivers/char/mem.c index f5c160caf9f..cc9a9d0df97 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -248,7 +247,7 @@ static unsigned long get_unmapped_area_mem(struct file *file, { if (!valid_mmap_phys_addr_range(pgoff, len)) return (unsigned long) -EINVAL; - return pgoff; + return pgoff << PAGE_SHIFT; } /* can't do an in-place private mapping if there's no MMU */ @@ -552,7 +551,7 @@ static ssize_t write_kmem(struct file * file, const char __user * buf, return virtr + wrote; } -#if (defined(CONFIG_ISA) || defined(CONFIG_PCI)) && !defined(__mc68000__) +#ifdef CONFIG_DEVPORT static ssize_t read_port(struct file * file, char __user * buf, size_t count, loff_t *ppos) { @@ -835,7 +834,7 @@ static const struct file_operations null_fops = { .splice_write = splice_write_null, }; -#if (defined(CONFIG_ISA) || defined(CONFIG_PCI)) && !defined(__mc68000__) +#ifdef CONFIG_DEVPORT static const struct file_operations port_fops = { .llseek = memory_lseek, .read = read_port, @@ -913,7 +912,7 @@ static int memory_open(struct inode * inode, struct file * filp) case 3: filp->f_op = &null_fops; break; -#if (defined(CONFIG_ISA) || defined(CONFIG_PCI)) && !defined(__mc68000__) +#ifdef CONFIG_DEVPORT case 4: filp->f_op = &port_fops; break; @@ -960,7 +959,7 @@ static const struct { {1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops}, {2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops}, {3, "null", S_IRUGO | S_IWUGO, &null_fops}, -#if (defined(CONFIG_ISA) || defined(CONFIG_PCI)) && !defined(__mc68000__) +#ifdef CONFIG_DEVPORT {4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops}, #endif {5, "zero", S_IRUGO | S_IWUGO, &zero_fops},