From 1327dcf75b55fe45beeb3fab77fd1383f643f538 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 23 Apr 2007 17:57:22 -0300 Subject: Plan-b: header change From: Alan Cox Signed-off-by: Alan Cox Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/planb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/drivers/media/video') diff --git a/linux/drivers/media/video/planb.h b/linux/drivers/media/video/planb.h index 92823211d..e21b5735c 100644 --- a/linux/drivers/media/video/planb.h +++ b/linux/drivers/media/video/planb.h @@ -177,6 +177,7 @@ struct planb { struct mutex lock; unsigned int irq; /* interrupt number */ volatile unsigned int intr_mask; + struct pci_dev *dev; /* Our PCI device */ int overlay; /* overlay running? */ struct planb_window win; -- cgit v1.2.3 From 6deaa5ff95d4836c569d26ec24174bbd2c591695 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 23 Apr 2007 17:57:28 -0300 Subject: Plan-b: Switch to refcounting PCI API From: Alan Cox Signed-off-by: Alan Cox Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/planb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'linux/drivers/media/video') diff --git a/linux/drivers/media/video/planb.c b/linux/drivers/media/video/planb.c index c393b26e1..c6f2dc6cf 100644 --- a/linux/drivers/media/video/planb.c +++ b/linux/drivers/media/video/planb.c @@ -2216,7 +2216,7 @@ static int find_planb(void) "membase 0x%x (base reg. 0x%x)\n", bus, PCI_SLOT(dev_fn), PCI_FUNC(dev_fn), old_base, confreg); - pdev = pci_find_slot (bus, dev_fn); + pdev = pci_get_bus_and_slot(bus, dev_fn); if (!pdev) { printk(KERN_ERR "planb: cannot find slot\n"); goto err_out; @@ -2246,6 +2246,7 @@ static int find_planb(void) pb->planb_base = planb_regs; pb->planb_base_phys = (struct planb_registers *)new_base; pb->irq = irq; + pb->dev = pdev; return planb_num; @@ -2253,6 +2254,7 @@ err_out_disable: pci_disable_device(pdev); err_out: /* FIXME handle error */ /* comment moved from pci_find_slot, above */ + pci_dev_put(pdev); return 0; } @@ -2280,6 +2282,8 @@ static void release_planb(void) printk(KERN_INFO "PlanB: unregistering with v4l\n"); video_unregister_device(&pb->video_dev); + pci_dev_put(pb->dev); + /* note that iounmap() does nothing on the PPC right now */ iounmap ((void *)pb->planb_base); } -- cgit v1.2.3 From 97120a47826d8984da2c888c7e8adb2aff7ee509 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 24 Apr 2007 13:40:07 -0300 Subject: Fix: vidioc_g_parm were not zeroing the memory From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/videodev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/video') diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c index acb3c4fbf..0443be210 100644 --- a/linux/drivers/media/video/videodev.c +++ b/linux/drivers/media/video/videodev.c @@ -1427,6 +1427,11 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_G_PARM: { struct v4l2_streamparm *p=arg; + __u32 type=p->type; + + memset(p,0,sizeof(*p)); + p->type=type; + if (vfd->vidioc_g_parm) { ret=vfd->vidioc_g_parm(file, fh, p); } else { @@ -1438,8 +1443,6 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, v4l2_video_std_construct(&s, vfd->current_norm, v4l2_norm_to_name(vfd->current_norm)); - memset(p,0,sizeof(*p)); - p->parm.capture.timeperframe = s.frameperiod; ret=0; } -- cgit v1.2.3 From 87e67f18a546d8461379f9f4df05102910f78c9a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 25 Apr 2007 00:20:13 -0300 Subject: cafe_ccic: check return value of pci_enable_device From: Trent Piepho Remove warnings Signed-off-by: Trent Piepho Acked-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cafe_ccic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'linux/drivers/media/video') diff --git a/linux/drivers/media/video/cafe_ccic.c b/linux/drivers/media/video/cafe_ccic.c index ea69590a1..041d87092 100644 --- a/linux/drivers/media/video/cafe_ccic.c +++ b/linux/drivers/media/video/cafe_ccic.c @@ -2222,7 +2222,11 @@ static int cafe_pci_resume(struct pci_dev *pdev) ret = pci_restore_state(pdev); if (ret) return ret; - pci_enable_device(pdev); + ret = pci_enable_device(pdev); + if (ret) { + cam_warn(cam, "Unable to re-enable device on resume!\n"); + return ret; + } cafe_ctlr_init(cam); cafe_ctlr_power_up(cam); set_bit(CF_CONFIG_NEEDED, &cam->flags); -- cgit v1.2.3