v4l: use usb_interface for v4l2_device_register
PATCH 1/1 v4l: use usb_interface for v4l2_device_register
In reply to a message not in the archive# HG changeset patch
# User Janne Grunau <[email protected]>
# Date 1238338428 -7200
# Node ID 36b738f9cb1916e9885084f32bb29373f70f0720 # Parent df7a51ffa2baddae044a318c928f960488b9ec38
v4l: use usb_interface for v4l2_device_register
If usb_interface.dev is used as dev parameter for v4l2_device_register v4l2_dev.name contains the v4l driver/module name and usb device and interface instead of a simple "usb x-y".
It also matches the recommendation to set the parent devices for usb drivers.
Priority: normal
linux/Documentation/video4linux/v4l2-framework.txt +1 -1
@@ -90,7 +90,7 @@ 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.
PATCH 1/1 cx231xx: use usb_interface.dev for v4l2_device_register
In reply to a message not in the archive# HG changeset patch
# User Janne Grunau <[email protected]>
# Date 1238338428 -7200
# Node ID eb7601494dc5e58ed519dde38c763fee20cbd0a9 # Parent 36b738f9cb1916e9885084f32bb29373f70f0720
cx231xx: use usb_interface.dev for v4l2_device_register
Priority: normal
linux/drivers/media/video/cx231xx/cx231xx-cards.c +1 -1
@@ -685,7 +685,7 @@/* 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);
PATCH 1/1 cx231xx: remove explicitly set v4l2_device.name
In reply to a message not in the archive# HG changeset patch
# User Janne Grunau <[email protected]>
# Date 1238338428 -7200
# Node ID ce50af27b414d4e146e6833b78852b42b129293a # Parent eb7601494dc5e58ed519dde38c763fee20cbd0a9
cx231xx: remove explicitly set v4l2_device.name
Priority: normal
linux/drivers/media/video/cx231xx/cx231xx-cards.c +0 -2
@@ -683,8 +683,6 @@*/ /* Create v4l2 device */ -snprintf (dev->v4l2_dev.name,sizeof (dev->v4l2_dev.name), -"%s-%03d" ,"cx231xx" , nr); retval =v4l2_device_register (&interface->dev, &dev->v4l2_dev);if (retval) {cx231xx_errdev ("v4l2_device_register failed\n" );
PATCH 1/1 usbvision: use usb_interface.dev for v4l2_device_register
In reply to a message not in the archive# HG changeset patch
# User Janne Grunau <[email protected]>
# Date 1238338428 -7200
# Node ID 01af508490af3bc9c939c36001d6989e2c147aa0 # Parent ce50af27b414d4e146e6833b78852b42b129293a
usbvision: use usb_interface.dev for v4l2_device_register
Priority: normal
linux/drivers/media/video/usbvision/usbvision-video.c +5 -3
@@ -1522,7 +1522,8 @@* 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 @@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 @@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 ; }
PATCH 1/1 pvrusb2: use usb_interface.dev for v4l2_device_register
In reply to a message not in the archive# HG changeset patch
# User Janne Grunau <[email protected]>
# Date 1238338428 -7200
# Node ID 2d52ac089920f9ac36960c0245442fd89a06bb75 # Parent 01af508490af3bc9c939c36001d6989e2c147aa0
pvrusb2: use usb_interface.dev for v4l2_device_register
Priority: normal
linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +1 -1
@@ -2591,7 +2591,7 @@ 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;
PATCH 1/1 au0828: use usb_interface.dev for v4l2_device_register
In reply to a message not in the archive# HG changeset patch
# User Janne Grunau <[email protected]>
# Date 1238338428 -7200
# Node ID 1fd54536517a9be6f93f5711766bb8efd64ddbdf # Parent 2d52ac089920f9ac36960c0245442fd89a06bb75
au0828: use usb_interface.dev for v4l2_device_register
Priority: normal
linux/drivers/media/video/au0828/au0828-core.c +1 -1
@@ -201,7 +201,7 @@ 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__);
PATCH 1/1 au0828: remove explicitly set v4l2_device.name and unused au0828_instance
In reply to a message not in the archive# HG changeset patch
# User Janne Grunau <[email protected]>
# Date 1238338428 -7200
# Node ID 9de2e49de0b75360d86b8fc444de057a485003c1
# Parent 1fd54536517a9be6f93f5711766bb8efd64ddbdf
au0828: remove explicitly set v4l2_device.name and unused au0828_instance
Priority: normal
linux/drivers/media/video/au0828/au0828-core.c +1 -6
@@ -37,8 +37,6 @@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_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,9 +196,6 @@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 (&interface->dev, &dev->v4l2_dev);if (retval) { printk(KERN_ERR "%s() v4l2_device_register failed\n",
PATCH 1/1 w9968cf: use usb_interface.dev for v4l2_device_register
In reply to a message not in the archive# HG changeset patch
# User Janne Grunau <[email protected]>
# Date 1238338428 -7200
# Node ID fcd789d767ee307c25a006528bcd1b021d56b732 # Parent 9de2e49de0b75360d86b8fc444de057a485003c1
w9968cf: use usb_interface.dev for v4l2_device_register
Priority: normal
linux/drivers/media/video/w9968cf.c +1 -1
@@ -3454,7 +3454,7 @@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;
Re: [PATCH 5 of 8] pvrusb2: use usb_interface.dev for v4l2_device_register
In reply to Janne GrunauThis patch will not at all impact the operation of the pvrusb2 driver, and if associating with the USB interface's device node is preferred then I'm fine with it.
Mauro: Is this series going to be pulled into v4l-dvb or shall I just bring this one specific change into my pvrusb2 repo? Is there any reason not to pull it?
-Mike
Quoted 28 lines · Janne Grunau
# HG changeset patch
# User Janne Grunau <[email protected]>
# Date 1238338428 -7200
# Node ID2d52ac089920f9ac36960c0245442fd89a06bb75# Parent01af508490af3bc9c939c36001d6989e2c147aa0
pvrusb2: use usb_interface.dev forv4l2_device_registerPriority: normal
Signed-off-by Janne Grunau <[email protected]>diff -r
01af508490af-r2d52ac089920linux/drivers/media/video/pvrusb2/pvrusb2-hdw.clinux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +1
-2@@ -2591,7 +2591,7 @@ 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; --To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
Mike Isely isely @ pobox (dot) com PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
Re: [PATCH 5 of 8] pvrusb2: use usb_interface.dev for v4l2_device_register
Quoted 10 lines · On Tue, 31 Mar 2009 21:02:16 -0500 (CDT) Mike Isely <[email protected]> wrote:
This patch will not at all impact the operation of the pvrusb2 driver, and if associating with the USB interface's device node is preferred then I'm fine with it.
Acked-by Mike Isely <[email protected]>Mauro: Is this series going to be pulled into v4l-dvb or shall I just bring this one specific change into my pvrusb2 repo? Is there any reason not to pull it?
I'll take care on it on the next time I'll apply patchwork patches. I suspect that Janne preferred to send via email for people to better analyse the impacts.
Quoted 24 lines
-Mike
Quoted 18 lines · Janne Grunau
# HG changeset patch
# User Janne Grunau <[email protected]>
# Date 1238338428 -7200
# Node ID2d52ac089920f9ac36960c0245442fd89a06bb75# Parent01af508490af3bc9c939c36001d6989e2c147aa0
pvrusb2: use usb_interface.dev forv4l2_device_registerPriority: normal
Signed-off-by Janne Grunau <[email protected]>diff -r
01af508490af-r2d52ac089920linux/drivers/media/video/pvrusb2/pvrusb2-hdw.clinux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +0
-0@@ -2591,7 +2591,7 @@ hdw->ctl_read_urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!hdw->ctl_read_urb) goto fail;
Quoted 11 lines
Quoted 10 lines
linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +1
-2-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; --To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Cheers,
Mauro
Re: [PATCH 5 of 8] pvrusb2: use usb_interface.dev for v4l2_device_register
Quoted 9 lines · Mauro Carvalho Chehab
Quoted 6 lines · On Tue, 31 Mar 2009 21:02:16 -0500 (CDT) Mike Isely <[email protected]> wrote:
This patch will not at all impact the operation of the pvrusb2 driver, and if associating with the USB interface's device node is preferred then I'm fine with it.
Acked-by Mike Isely <[email protected]>
Thanks, added.
Quoted 5 lines
Quoted 3 lines
Mauro: Is this series going to be pulled into v4l-dvb or shall I just bring this one specific change into my pvrusb2 repo? Is there any reason not to pull it?
I'll take care on it on the next time I'll apply patchwork patches.
You don't need to. My plan was to send a pull request once I have enough feedback. I should have said that in the intro mail.
Quoted 2 lines
I suspect
that Janne preferred to send via email for people to better analyse the impacts.
Yes, exactly.
Janne