X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fsbus%2Fchar%2Fvfc_dev.c;h=386e7de0b7e3c47a38efdda9ed01def8fc6839d6;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=86ce54130954979c9eb4abb7632712805e4c13c7;hpb=f7f1b0f1e2fbadeab12d24236000e778aa9b1ead;p=linux-2.6.git diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 86ce54130..386e7de0b 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c @@ -137,7 +137,6 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance) dev->instance=instance; init_MUTEX(&dev->device_lock_sem); dev->control_reg=0; - init_waitqueue_head(&dev->poll_wait); dev->busy=0; return 0; } @@ -150,7 +149,7 @@ int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance) } printk("Initializing vfc%d\n",instance); dev->regs = NULL; - dev->regs = (volatile struct vfc_regs *) + dev->regs = (volatile struct vfc_regs __iomem *) sbus_ioremap(&sdev->resource[0], 0, sizeof(struct vfc_regs), vfcstr); dev->which_io = sdev->reg_addrs[0].which_io; @@ -165,10 +164,6 @@ 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; } @@ -320,7 +315,7 @@ int vfc_capture_poll(struct vfc_dev *dev) int timeout = 1000; while (!timeout--) { - if (dev->regs->control & VFC_STATUS_CAPTURE) + if (sbus_readl(&dev->regs->control) & VFC_STATUS_CAPTURE) break; vfc_i2c_delay_no_busy(dev, 100); } @@ -615,7 +610,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma) unsigned int map_size, ret, map_offset; struct vfc_dev *dev; - dev = vfc_get_dev_ptr(iminor(file->f_dentry->d_inode)); + dev = vfc_get_dev_ptr(iminor(file->f_path.dentry->d_inode)); if(dev == NULL) return -ENODEV; @@ -624,7 +619,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma) map_size = sizeof(struct vfc_regs); vma->vm_flags |= - (VM_SHM | VM_LOCKED | VM_IO | VM_MAYREAD | VM_MAYWRITE | VM_MAYSHARE); + (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, @@ -664,7 +659,7 @@ static int vfc_probe(void) if (!cards) return -ENODEV; - vfc_dev_lst = (struct vfc_dev **)kmalloc(sizeof(struct vfc_dev *) * + vfc_dev_lst = kmalloc(sizeof(struct vfc_dev *) * (cards+1), GFP_KERNEL); if (vfc_dev_lst == NULL) @@ -678,7 +673,6 @@ 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) { @@ -718,8 +712,7 @@ static void deinit_vfc_device(struct vfc_dev *dev) { if(dev == NULL) return; - devfs_remove("vfc/%d", dev->instance); - sbus_iounmap((unsigned long)dev->regs, sizeof(struct vfc_regs)); + sbus_iounmap(dev->regs, sizeof(struct vfc_regs)); kfree(dev); } @@ -732,7 +725,6 @@ void cleanup_module(void) for (devp = vfc_dev_lst; *devp; devp++) deinit_vfc_device(*devp); - devfs_remove("vfc"); kfree(vfc_dev_lst); return; }