linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / sbus / char / vfc_dev.c
index 55b2b31..dfdd6be 100644 (file)
@@ -164,6 +164,10 @@ int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance)
                return -EINVAL;
        if (init_vfc_hw(dev))
                return -EIO;
+
+       devfs_mk_cdev(MKDEV(VFC_MAJOR, instance),
+                       S_IFCHR | S_IRUSR | S_IWUSR,
+                       "vfc/%d", instance);
        return 0;
 }
 
@@ -619,7 +623,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma)
                map_size = sizeof(struct vfc_regs);
 
        vma->vm_flags |=
-               (VM_MAYREAD | VM_MAYWRITE | VM_MAYSHARE);
+               (VM_SHM | VM_LOCKED | VM_IO | VM_MAYREAD | VM_MAYWRITE | VM_MAYSHARE);
        map_offset = (unsigned int) (long)dev->phys_regs;
        ret = io_remap_pfn_range(vma, vma->vm_start,
                                  MK_IOSPACE_PFN(dev->which_io,
@@ -673,6 +677,7 @@ static int vfc_probe(void)
                kfree(vfc_dev_lst);
                return -EIO;
        }
+       devfs_mk_dir("vfc");
        instance = 0;
        for_all_sbusdev(sdev, sbus) {
                if (strcmp(sdev->prom_name, "vfc") == 0) {
@@ -712,6 +717,7 @@ static void deinit_vfc_device(struct vfc_dev *dev)
 {
        if(dev == NULL)
                return;
+       devfs_remove("vfc/%d", dev->instance);
        sbus_iounmap(dev->regs, sizeof(struct vfc_regs));
        kfree(dev);
 }
@@ -725,6 +731,7 @@ void cleanup_module(void)
        for (devp = vfc_dev_lst; *devp; devp++)
                deinit_vfc_device(*devp);
 
+       devfs_remove("vfc");
        kfree(vfc_dev_lst);
        return;
 }