The patch number 11359 was added via Mauro Carvalho Chehab <mche...@redhat.com> to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel If anyone has any objections, please let us know by sending a message to: Linux Media Mailing List <linux-me...@vger.kernel.org> ------ From: Mauro Carvalho Chehab <mche...@redhat.com> merge: http://hg.jannau.net/v4l-dvb/ Priority: normal Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com> --- linux/Documentation/video4linux/v4l2-framework.txt | 2 +- linux/drivers/media/video/au0828/au0828-core.c | 9 ++------- linux/drivers/media/video/cx231xx/cx231xx-cards.c | 4 +--- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 2 +- linux/drivers/media/video/usbvision/usbvision-video.c | 8 +++++--- linux/drivers/media/video/w9968cf.c | 2 +- 6 files changed, 11 insertions(+), 16 deletions(-) diff -r f115ddf29d64 -r 82f55c647f78 linux/Documentation/video4linux/v4l2-framework.txt --- a/linux/Documentation/video4linux/v4l2-framework.txt Fri Apr 03 15:34:05 2009 +0200 +++ b/linux/Documentation/video4linux/v4l2-framework.txt Sun Apr 05 07:56:10 2009 -0300 @@ -90,7 +90,7 @@ NULL, then you *must* setup v4l2_dev->na NULL, then you *must* setup v4l2_dev->name before calling v4l2_device_register. The first 'dev' argument is normally the struct device pointer of a pci_dev, -usb_device or platform_device. It is rare for dev to be NULL, but it happens +usb_interface or platform_device. It is rare for dev to be NULL, but it happens with ISA devices or when one device creates multiple PCI devices, thus making it impossible to associate v4l2_dev with a particular parent. diff -r f115ddf29d64 -r 82f55c647f78 linux/drivers/media/video/au0828/au0828-core.c --- a/linux/drivers/media/video/au0828/au0828-core.c Fri Apr 03 15:34:05 2009 +0200 +++ b/linux/drivers/media/video/au0828/au0828-core.c Sun Apr 05 07:56:10 2009 -0300 @@ -36,8 +36,6 @@ int au0828_debug; int au0828_debug; module_param_named(debug, au0828_debug, int, 0644); MODULE_PARM_DESC(debug, "enable debug messages"); - -static atomic_t au0828_instance = ATOMIC_INIT(0); #define _AU0828_BULKPIPE 0x03 #define _BULKPIPESIZE 0xffff @@ -170,7 +168,7 @@ static int au0828_usb_probe(struct usb_i static int au0828_usb_probe(struct usb_interface *interface, const struct usb_device_id *id) { - int ifnum, retval, i; + int ifnum, retval; struct au0828_dev *dev; struct usb_device *usbdev = interface_to_usbdev(interface); @@ -198,10 +196,7 @@ static int au0828_usb_probe(struct usb_i usb_set_intfdata(interface, dev); /* Create the v4l2_device */ - i = atomic_inc_return(&au0828_instance) - 1; - snprintf(dev->v4l2_dev.name, sizeof(dev->v4l2_dev.name), "%s-%03d", - "au0828", i); - retval = v4l2_device_register(&dev->usbdev->dev, &dev->v4l2_dev); + retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev); if (retval) { printk(KERN_ERR "%s() v4l2_device_register failed\n", __func__); diff -r f115ddf29d64 -r 82f55c647f78 linux/drivers/media/video/cx231xx/cx231xx-cards.c --- a/linux/drivers/media/video/cx231xx/cx231xx-cards.c Fri Apr 03 15:34:05 2009 +0200 +++ b/linux/drivers/media/video/cx231xx/cx231xx-cards.c Sun Apr 05 07:56:10 2009 -0300 @@ -683,9 +683,7 @@ static int cx231xx_usb_probe(struct usb_ */ /* Create v4l2 device */ - snprintf(dev->v4l2_dev.name, sizeof(dev->v4l2_dev.name), - "%s-%03d", "cx231xx", nr); - retval = v4l2_device_register(&udev->dev, &dev->v4l2_dev); + retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev); if (retval) { cx231xx_errdev("v4l2_device_register failed\n"); cx231xx_devused &= ~(1 << nr); diff -r f115ddf29d64 -r 82f55c647f78 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Apr 03 15:34:05 2009 +0200 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Apr 05 07:56:10 2009 -0300 @@ -2591,7 +2591,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct hdw->ctl_read_urb = usb_alloc_urb(0,GFP_KERNEL); if (!hdw->ctl_read_urb) goto fail; - if (v4l2_device_register(&usb_dev->dev, &hdw->v4l2_dev) != 0) { + if (v4l2_device_register(&intf->dev, &hdw->v4l2_dev) != 0) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Error registering with v4l core, giving up"); goto fail; diff -r f115ddf29d64 -r 82f55c647f78 linux/drivers/media/video/usbvision/usbvision-video.c --- a/linux/drivers/media/video/usbvision/usbvision-video.c Fri Apr 03 15:34:05 2009 +0200 +++ b/linux/drivers/media/video/usbvision/usbvision-video.c Sun Apr 05 07:56:10 2009 -0300 @@ -1522,7 +1522,8 @@ static int __devinit usbvision_register_ * Returns NULL on error, a pointer to usb_usbvision else. * */ -static struct usb_usbvision *usbvision_alloc(struct usb_device *dev) +static struct usb_usbvision *usbvision_alloc(struct usb_device *dev, + struct usb_interface *intf) { struct usb_usbvision *usbvision; @@ -1531,7 +1532,7 @@ static struct usb_usbvision *usbvision_a return NULL; usbvision->dev = dev; - if (v4l2_device_register(&dev->dev, &usbvision->v4l2_dev)) + if (v4l2_device_register(&intf->dev, &usbvision->v4l2_dev)) goto err_free; mutex_init(&usbvision->lock); /* available */ @@ -1669,7 +1670,8 @@ static int __devinit usbvision_probe(str return -ENODEV; } - if ((usbvision = usbvision_alloc(dev)) == NULL) { + usbvision = usbvision_alloc(dev, intf); + if (usbvision == NULL) { dev_err(&intf->dev, "%s: couldn't allocate USBVision struct\n", __func__); return -ENOMEM; } diff -r f115ddf29d64 -r 82f55c647f78 linux/drivers/media/video/w9968cf.c --- a/linux/drivers/media/video/w9968cf.c Fri Apr 03 15:34:05 2009 +0200 +++ b/linux/drivers/media/video/w9968cf.c Sun Apr 05 07:56:10 2009 -0300 @@ -3454,7 +3454,7 @@ w9968cf_usb_probe(struct usb_interface* if (!cam) return -ENOMEM; - err = v4l2_device_register(&udev->dev, &cam->v4l2_dev); + err = v4l2_device_register(&intf->dev, &cam->v4l2_dev); if (err) goto fail0; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/82f55c647f7804270d99f3b4e7a90d25ecf4e623 _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits