static
void __init handle_chipset(void)
{
- struct pci_dev *dev = NULL;
-
/* Just in case some nut set this to something dangerous */
if (triton1)
triton1 = ZORAN_VDC_TRICOM;
- while ((dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437, dev)))
- {
+ if (pci_pci_problems & PCIPCI_TRITON) {
printk(KERN_INFO "zoran: Host bridge 82437FX Triton PIIX\n");
triton1 = ZORAN_VDC_TRICOM;
}
{
u32 stat,estat;
int count = 0;
- struct zoran *ztv = (struct zoran *)dev_id;
+ struct zoran *ztv = dev_id;
UNUSED(irq); UNUSED(regs);
for (;;) {
memset(ztv->fbuffer,0,ZORAN_MAX_FBUFSIZE);
if (!ztv->overinfo.overlay)
- ztv->overinfo.overlay = (void*)kmalloc(1024*1024/8, GFP_KERNEL);
+ ztv->overinfo.overlay = kmalloc(1024*1024/8, GFP_KERNEL);
if (!ztv->overinfo.overlay) {
/* could not get an overlay buffer, bail out */
bfree(ztv->fbuffer, ZORAN_MAX_FBUFSIZE);
* be sure its safe to free the buffer. We wait 5-6 fields
* which is more than sufficient to be sure.
*/
- current->state = TASK_UNINTERRUPTIBLE;
- schedule_timeout(HZ/10); /* Wait 1/10th of a second */
+ msleep(100); /* Wait 1/10th of a second */
/* free the allocated framebuffer */
if (ztv->fbuffer)
/* start mapping the whole shabang to user memory */
pos = (unsigned long)ztv->fbuffer;
while (size>0) {
- unsigned long page = virt_to_phys((void*)pos);
- if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
+ unsigned long pfn = virt_to_phys((void*)pos) >> PAGE_SHIFT;
+ if (remap_pfn_range(vma, start, pfn, PAGE_SIZE, PAGE_SHARED))
return -EAGAIN;
start += PAGE_SIZE;
pos += PAGE_SIZE;
static
int vbi_open(struct video_device *dev, int flags)
{
- struct zoran *ztv = (struct zoran*)dev->priv;
+ struct zoran *ztv = dev->priv;
struct vidinfo* item;
DEBUG(printk(CARD_DEBUG "vbi_open(dev,%d)\n",CARD,flags));
static
void vbi_close(struct video_device *dev)
{
- struct zoran *ztv = (struct zoran*)dev->priv;
+ struct zoran *ztv = dev->priv;
struct vidinfo* item;
DEBUG(printk(CARD_DEBUG "vbi_close(dev)\n",CARD));
* be sure its safe to free the buffer. We wait 5-6 fields
* which is more than sufficient to be sure.
*/
- current->state = TASK_UNINTERRUPTIBLE;
- schedule_timeout(HZ/10); /* Wait 1/10th of a second */
+ msleep(100); /* Wait 1/10th of a second */
for (item=ztv->readinfo; item!=ztv->readinfo+ZORAN_VBI_BUFFERS; item++)
{
static
long vbi_read(struct video_device* dev, char* buf, unsigned long count, int nonblock)
{
- struct zoran *ztv = (struct zoran*)dev->priv;
+ struct zoran *ztv = dev->priv;
unsigned long max;
struct vidinfo* unused = 0;
struct vidinfo* done = 0;
static
unsigned int vbi_poll(struct video_device *dev, struct file *file, poll_table *wait)
{
- struct zoran *ztv = (struct zoran*)dev->priv;
+ struct zoran *ztv = dev->priv;
struct vidinfo* item;
unsigned int mask = 0;
static
int vbi_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
{
- struct zoran* ztv = (struct zoran*)dev->priv;
+ struct zoran* ztv = dev->priv;
switch (cmd) {
case VIDIOCGVBIFMT:
DEBUG(printk(KERN_DEBUG "zoran: mapped-memory at 0x%p\n",ztv->zoran_mem));
result = request_irq(dev->irq, zoran_irq,
- SA_SHIRQ|SA_INTERRUPT,"zoran",(void *)ztv);
+ SA_SHIRQ|SA_INTERRUPT,"zoran", ztv);
if (result==-EINVAL)
{
iounmap(ztv->zoran_mem);
ztv->tuner_type = 0;
ztv->running = 0;
ztv->users = 0;
- ztv->lock = RW_LOCK_UNLOCKED;
+ rwlock_init(&ztv->lock);
ztv->workqueue = 0;
ztv->fieldnr = 0;
ztv->lastfieldnr = 0;