public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1 of 6] v4l: use usb_interface for v4l2_device_register
       [not found] <patchbomb.1238329154@aniel>
@ 2009-03-29 12:37 ` Janne Grunau
  2009-03-29 12:40 ` [PATCH 2 of 6] cx321xx: use usb_interface.dev " Janne Grunau
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2009-03-29 12:37 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

[-- Attachment #1: v4l2_device_usb_interface-1.patch --]
[-- Type: text/x-patch, Size: 1334 bytes --]

# HG changeset patch
# User Janne Grunau <j@jannau.net>
# Date 1238189646 -3600
# Node ID 602a8fff1ba466ec4fb4816d0fb0725c8650c311
# Parent  b1596c6517c925abd1e683e86592af1aedf9de06
v4l: use usb_interface for v4l2_device_register

From: Janne Grunau <j@jannau.net>

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

Signed-off-by: Janne Grunau <j@jannau.net>

diff -r b1596c6517c9 -r 602a8fff1ba4 linux/Documentation/video4linux/v4l2-framework.txt
--- a/linux/Documentation/video4linux/v4l2-framework.txt	Thu Mar 26 20:47:48 2009 +0000
+++ b/linux/Documentation/video4linux/v4l2-framework.txt	Fri Mar 27 22:34:06 2009 +0100
@@ -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.
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2 of 6] cx321xx: use usb_interface.dev for v4l2_device_register
       [not found] <patchbomb.1238329154@aniel>
  2009-03-29 12:37 ` [PATCH 1 of 6] v4l: use usb_interface for v4l2_device_register Janne Grunau
@ 2009-03-29 12:40 ` Janne Grunau
  2009-03-29 12:41 ` [PATCH 3 of 6] usbvision: " Janne Grunau
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2009-03-29 12:40 UTC (permalink / raw)
  To: linux-media; +Cc: Srinivasa Deevi

[-- Attachment #1: v4l2_device_usb_interface-2.patch --]
[-- Type: text/x-patch, Size: 1018 bytes --]

# HG changeset patch
# User Janne Grunau <j@jannau.net>
# Date 1238190165 -3600
# Node ID edca57a287041646c86b404852ef9abf0ecd6c72
# Parent  602a8fff1ba466ec4fb4816d0fb0725c8650c311
cx321xx: use usb_interface.dev for v4l2_device_register

From: Janne Grunau <j@jannau.net>

removes the explicitly set v4l2_device.name

Priority: normal

Signed-off-by: Janne Grunau <j@jannau.net>

diff -r 602a8fff1ba4 -r edca57a28704 linux/drivers/media/video/cx231xx/cx231xx-cards.c
--- a/linux/drivers/media/video/cx231xx/cx231xx-cards.c	Fri Mar 27 22:34:06 2009 +0100
+++ b/linux/drivers/media/video/cx231xx/cx231xx-cards.c	Fri Mar 27 22:42:45 2009 +0100
@@ -683,9 +683,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);

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3 of 6] usbvision: use usb_interface.dev for v4l2_device_register
       [not found] <patchbomb.1238329154@aniel>
  2009-03-29 12:37 ` [PATCH 1 of 6] v4l: use usb_interface for v4l2_device_register Janne Grunau
  2009-03-29 12:40 ` [PATCH 2 of 6] cx321xx: use usb_interface.dev " Janne Grunau
@ 2009-03-29 12:41 ` Janne Grunau
  2009-03-29 12:42 ` [PATCH 4 of 6] pvrusb2: " Janne Grunau
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2009-03-29 12:41 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: v4l2_device_usb_interface-3.patch --]
[-- Type: text/x-patch, Size: 1445 bytes --]

# HG changeset patch
# User Janne Grunau <j@jannau.net>
# Date 1238190800 -3600
# Node ID 09d6b9873181402892bb746d101b1b22b245208d
# Parent  edca57a287041646c86b404852ef9abf0ecd6c72
usbvision: use usb_interface.dev for v4l2_device_register

From: Janne Grunau <j@jannau.net>

Priority: normal

Signed-off-by: Janne Grunau <j@jannau.net>

diff -r edca57a28704 -r 09d6b9873181 linux/drivers/media/video/usbvision/usbvision-video.c
--- a/linux/drivers/media/video/usbvision/usbvision-video.c	Fri Mar 27 22:42:45 2009 +0100
+++ b/linux/drivers/media/video/usbvision/usbvision-video.c	Fri Mar 27 22:53:20 2009 +0100
@@ -1530,7 +1530,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;
 
@@ -1539,7 +1540,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 */
@@ -1677,7 +1678,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;
 	}

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4 of 6] pvrusb2: use usb_interface.dev for v4l2_device_register
       [not found] <patchbomb.1238329154@aniel>
                   ` (2 preceding siblings ...)
  2009-03-29 12:41 ` [PATCH 3 of 6] usbvision: " Janne Grunau
@ 2009-03-29 12:42 ` Janne Grunau
  2009-03-29 12:42 ` [PATCH 5 of 6] au0828: " Janne Grunau
  2009-03-29 12:43 ` [PATCH 6 of 6] w9968cf: " Janne Grunau
  5 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2009-03-29 12:42 UTC (permalink / raw)
  To: linux-media; +Cc: Mike Isely

[-- Attachment #1: v4l2_device_usb_interface-4.patch --]
[-- Type: text/x-patch, Size: 937 bytes --]

# HG changeset patch
# User Janne Grunau <j@jannau.net>
# Date 1238190885 -3600
# Node ID 210007cef5bdef2364590755a2b7ab219534db16
# Parent  09d6b9873181402892bb746d101b1b22b245208d
pvrusb2: use usb_interface.dev for v4l2_device_register

From: Janne Grunau <j@jannau.net>

Priority: normal

Signed-off-by: Janne Grunau <j@jannau.net>

diff -r 09d6b9873181 -r 210007cef5bd linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c	Fri Mar 27 22:53:20 2009 +0100
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c	Fri Mar 27 22:54:45 2009 +0100
@@ -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;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5 of 6] au0828: use usb_interface.dev for v4l2_device_register
       [not found] <patchbomb.1238329154@aniel>
                   ` (3 preceding siblings ...)
  2009-03-29 12:42 ` [PATCH 4 of 6] pvrusb2: " Janne Grunau
@ 2009-03-29 12:42 ` Janne Grunau
  2009-03-29 13:44   ` Devin Heitmueller
  2009-03-29 12:43 ` [PATCH 6 of 6] w9968cf: " Janne Grunau
  5 siblings, 1 reply; 8+ messages in thread
From: Janne Grunau @ 2009-03-29 12:42 UTC (permalink / raw)
  To: linux-media; +Cc: Steven Toth

[-- Attachment #1: v4l2_device_usb_interface-5.patch --]
[-- Type: text/x-patch, Size: 1048 bytes --]

# HG changeset patch
# User Janne Grunau <j@jannau.net>
# Date 1238191025 -3600
# Node ID 16016db934ee03d0156754b8e07d4212c933d234
# Parent  210007cef5bdef2364590755a2b7ab219534db16
au0828: use usb_interface.dev for v4l2_device_register

From: Janne Grunau <j@jannau.net>

removes the explicitly set v4l2_device.name

Priority: normal

Signed-off-by: Janne Grunau <j@jannau.net>

diff -r 210007cef5bd -r 16016db934ee linux/drivers/media/video/au0828/au0828-core.c
--- a/linux/drivers/media/video/au0828/au0828-core.c	Fri Mar 27 22:54:45 2009 +0100
+++ b/linux/drivers/media/video/au0828/au0828-core.c	Fri Mar 27 22:57:05 2009 +0100
@@ -199,9 +199,7 @@
 
 	/* 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__);

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 6 of 6] w9968cf: use usb_interface.dev for v4l2_device_register
       [not found] <patchbomb.1238329154@aniel>
                   ` (4 preceding siblings ...)
  2009-03-29 12:42 ` [PATCH 5 of 6] au0828: " Janne Grunau
@ 2009-03-29 12:43 ` Janne Grunau
  5 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2009-03-29 12:43 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: v4l2_device_usb_interface-6.patch --]
[-- Type: text/x-patch, Size: 754 bytes --]

# HG changeset patch
# User Janne Grunau <j@jannau.net>
# Date 1238191413 -3600
# Node ID a37ea4c88edbaa73ef7a145986ab8f5c3ea9fa65
# Parent  16016db934ee03d0156754b8e07d4212c933d234
w9968cf: use usb_interface.dev for v4l2_device_register

From: Janne Grunau <j@jannau.net>

Priority: normal

Signed-off-by: Janne Grunau <j@jannau.net>

diff -r 16016db934ee -r a37ea4c88edb linux/drivers/media/video/w9968cf.c
--- a/linux/drivers/media/video/w9968cf.c	Fri Mar 27 22:57:05 2009 +0100
+++ b/linux/drivers/media/video/w9968cf.c	Fri Mar 27 23:03:33 2009 +0100
@@ -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;
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 5 of 6] au0828: use usb_interface.dev for v4l2_device_register
  2009-03-29 12:42 ` [PATCH 5 of 6] au0828: " Janne Grunau
@ 2009-03-29 13:44   ` Devin Heitmueller
  2009-03-29 15:04     ` Janne Grunau
  0 siblings, 1 reply; 8+ messages in thread
From: Devin Heitmueller @ 2009-03-29 13:44 UTC (permalink / raw)
  To: Janne Grunau; +Cc: linux-media, Steven Toth

On Sun, Mar 29, 2009 at 8:42 AM, Janne Grunau <j@jannau.net> wrote:
>

Hello Janne,

I'm not against this change, but you should also get rid of the "i"
variable and the au0828_instance list (since the v4l2_device.name was
the only purpose for both).

Also, your subject didn't really match the function of the patch.  Had
I not looked at the patch itself, I would have only thought you were
changing the v4l2_device_register().

Please put me on the CC: for anything related to au0828 analog
support, since I authored the code in question.

Thanks,

Devin

-- 
Devin J. Heitmueller
http://www.devinheitmueller.com
AIM: devinheitmueller

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 5 of 6] au0828: use usb_interface.dev for v4l2_device_register
  2009-03-29 13:44   ` Devin Heitmueller
@ 2009-03-29 15:04     ` Janne Grunau
  0 siblings, 0 replies; 8+ messages in thread
From: Janne Grunau @ 2009-03-29 15:04 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: linux-media, Steven Toth

Hi Devin,

On Sun, Mar 29, 2009 at 09:44:25AM -0400, Devin Heitmueller wrote:
> On Sun, Mar 29, 2009 at 8:42 AM, Janne Grunau <j@jannau.net> wrote:
> >
> 
> I'm not against this change, but you should also get rid of the "i"
> variable and the au0828_instance list (since the v4l2_device.name was
> the only purpose for both).

done

> Also, your subject didn't really match the function of the patch.  Had
> I not looked at the patch itself, I would have only thought you were
> changing the v4l2_device_register().

yeah, the subject was bad for au0828 and cx231xx but I had trouble to
find find something better. I splitted the patches nao.

> Please put me on the CC: for anything related to au0828 analog
> support, since I authored the code in question.

noted, Sorry I had only looked at the au0228-core.c header which notes
only Steven.

Janne

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-03-29 15:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <patchbomb.1238329154@aniel>
2009-03-29 12:37 ` [PATCH 1 of 6] v4l: use usb_interface for v4l2_device_register Janne Grunau
2009-03-29 12:40 ` [PATCH 2 of 6] cx321xx: use usb_interface.dev " Janne Grunau
2009-03-29 12:41 ` [PATCH 3 of 6] usbvision: " Janne Grunau
2009-03-29 12:42 ` [PATCH 4 of 6] pvrusb2: " Janne Grunau
2009-03-29 12:42 ` [PATCH 5 of 6] au0828: " Janne Grunau
2009-03-29 13:44   ` Devin Heitmueller
2009-03-29 15:04     ` Janne Grunau
2009-03-29 12:43 ` [PATCH 6 of 6] w9968cf: " Janne Grunau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox