aboutsummaryrefslogtreecommitdiff
path: root/arch/um/drivers/mmapper_kern.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2005-06-08 15:47:50 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-08 16:21:11 -0700
commit3df59529ad1045da61698bb5dd8ebaa547aeb46f (patch)
treef7370854b4c8aa3a6c72990b00094dc454b3e039 /arch/um/drivers/mmapper_kern.c
parenta38133298fc678335a0229e97b6161a7ac6fec84 (diff)
[PATCH] uml: make the emulated iomem driver work on 2.6
This makes the minimal fixes needed to make the UML iomem driver work in 2.6. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers/mmapper_kern.c')
-rw-r--r--arch/um/drivers/mmapper_kern.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c
index a63231dffe0..a37a5ac13c2 100644
--- a/arch/um/drivers/mmapper_kern.c
+++ b/arch/um/drivers/mmapper_kern.c
@@ -18,6 +18,7 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
+#include <linux/miscdevice.h>
#include <asm/uaccess.h>
#include <asm/irq.h>
#include <asm/pgtable.h>
@@ -117,24 +118,39 @@ static struct file_operations mmapper_fops = {
.release = mmapper_release,
};
+static struct miscdevice mmapper_dev = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = "mmapper",
+ .fops = &mmapper_fops
+};
+
static int __init mmapper_init(void)
{
+ int err;
+
printk(KERN_INFO "Mapper v0.1\n");
v_buf = (char *) find_iomem("mmapper", &mmapper_size);
if(mmapper_size == 0){
printk(KERN_ERR "mmapper_init - find_iomem failed\n");
- return(0);
+ goto out;
}
- p_buf = __pa(v_buf);
+ err = misc_register(&mmapper_dev);
+ if(err){
+ printk(KERN_ERR "mmapper - misc_register failed, err = %d\n",
+ err);
+ goto out;
+ }
- devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUGO|S_IWUGO, "mmapper");
- return(0);
+ p_buf = __pa(v_buf);
+out:
+ return 0;
}
static void mmapper_exit(void)
{
+ misc_deregister(&mmapper_dev);
}
module_init(mmapper_init);