git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
sbus
/
char
/
vfc_dev.c
diff --git
a/drivers/sbus/char/vfc_dev.c
b/drivers/sbus/char/vfc_dev.c
index
ad29b49
..
dfdd6be
100644
(file)
--- 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;
dev->instance=instance;
init_MUTEX(&dev->device_lock_sem);
dev->control_reg=0;
- init_waitqueue_head(&dev->poll_wait);
dev->busy=0;
return 0;
}
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;
}
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;
sbus_ioremap(&sdev->resource[0], 0,
sizeof(struct vfc_regs), vfcstr);
dev->which_io = sdev->reg_addrs[0].which_io;
@@
-178,7
+177,7
@@
struct vfc_dev *vfc_get_dev_ptr(int instance)
return vfc_dev_lst[instance];
}
return vfc_dev_lst[instance];
}
-static
spinlock_t vfc_dev_lock = SPIN_LOCK_UNLOCKED
;
+static
DEFINE_SPINLOCK(vfc_dev_lock)
;
static int vfc_open(struct inode *inode, struct file *file)
{
static int vfc_open(struct inode *inode, struct file *file)
{
@@
-320,7
+319,7
@@
int vfc_capture_poll(struct vfc_dev *dev)
int timeout = 1000;
while (!timeout--) {
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);
}
break;
vfc_i2c_delay_no_busy(dev, 100);
}
@@
-626,8
+625,10
@@
static int vfc_mmap(struct file *file, struct vm_area_struct *vma)
vma->vm_flags |=
(VM_SHM | VM_LOCKED | VM_IO | VM_MAYREAD | VM_MAYWRITE | VM_MAYSHARE);
map_offset = (unsigned int) (long)dev->phys_regs;
vma->vm_flags |=
(VM_SHM | VM_LOCKED | VM_IO | VM_MAYREAD | VM_MAYWRITE | VM_MAYSHARE);
map_offset = (unsigned int) (long)dev->phys_regs;
- ret = io_remap_page_range(vma, vma->vm_start, map_offset, map_size,
- vma->vm_page_prot, dev->which_io);
+ ret = io_remap_pfn_range(vma, vma->vm_start,
+ MK_IOSPACE_PFN(dev->which_io,
+ map_offset >> PAGE_SHIFT),
+ map_size, vma->vm_page_prot);
if(ret)
return -EAGAIN;
if(ret)
return -EAGAIN;
@@
-717,7
+718,7
@@
static void deinit_vfc_device(struct vfc_dev *dev)
if(dev == NULL)
return;
devfs_remove("vfc/%d", dev->instance);
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);
}
kfree(dev);
}