summaryrefslogtreecommitdiff
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-04-16 15:20:06 +0200
committerTakashi Iwai <tiwai@suse.de>2010-04-16 15:20:06 +0200
commitcf0dbba515415bb19b11f9323d5f7bebd7f24fd6 (patch)
tree375bbc1ade1a92acd6493d224dd701fd7f209014 /drivers/char/mem.c
parent1cff399ecd9125d8e6a634a1957be1aeb3195a12 (diff)
parent0340c7dccd80d8706c636e030a6ebbddbddca690 (diff)
Merge remote branch 'alsa/devel' into topic/misc
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r--drivers/char/mem.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 1f3215ac085b..f54dab8acdcd 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -225,6 +225,7 @@ int __weak phys_mem_access_prot_allowed(struct file *file,
* outside of main memory.
*
*/
+#ifdef pgprot_noncached
static int uncached_access(struct file *file, unsigned long addr)
{
#if defined(CONFIG_IA64)
@@ -251,6 +252,7 @@ static int uncached_access(struct file *file, unsigned long addr)
return addr >= __pa(high_memory);
#endif
}
+#endif
static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
unsigned long size, pgprot_t vma_prot)
@@ -710,11 +712,6 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
switch (orig) {
case SEEK_CUR:
offset += file->f_pos;
- if ((unsigned long long)offset <
- (unsigned long long)file->f_pos) {
- ret = -EOVERFLOW;
- break;
- }
case SEEK_SET:
/* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */
if ((unsigned long long)offset >= ~0xFFFULL) {
@@ -908,6 +905,9 @@ static int __init chr_dev_init(void)
printk("unable to get major %d for memory devs\n", MEM_MAJOR);
mem_class = class_create(THIS_MODULE, "mem");
+ if (IS_ERR(mem_class))
+ return PTR_ERR(mem_class);
+
mem_class->devnode = mem_devnode;
for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) {
if (!devlist[minor].name)