The patch number 13222 was added via Mike Isely <is...@pobox.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: Mike Isely  <is...@pobox.com>
pvrusb2: Make more info available to udev


pvrusb2: Associate V4L device node in sysfs with the underlying USB
device.  This opens the door to device information tracking in udev

Priority: normal

Signed-off-by: Mike Isely <is...@pobox.com>


---

 linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c |   21 +++++++++++----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff -r 5578cc977a13 -r 8b198ce54889 
linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c  Sun Oct 11 07:23:11 
2009 -0300
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c  Sun Oct 11 22:13:28 
2009 -0500
@@ -914,6 +914,19 @@
 }
 
 
+static void pvr2_v4l2_dev_disassociate_parent(struct pvr2_v4l2_dev *dip)
+{
+       if (!dip) return;
+       if (!dip->devbase.parent) return;
+       dip->devbase.parent = NULL;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30))
+       device_move(&dip->devbase.dev, NULL, DPM_ORDER_NONE);
+#else
+       device_move(&dip->devbase.dev, NULL);
+#endif
+}
+
+
 static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp)
 {
        if (vp->dev_video) {
@@ -944,6 +957,8 @@
        struct pvr2_v4l2 *vp;
        vp = container_of(chp,struct pvr2_v4l2,channel);
        if (!vp->channel.mc_head->disconnect_flag) return;
+       pvr2_v4l2_dev_disassociate_parent(vp->dev_video);
+       pvr2_v4l2_dev_disassociate_parent(vp->dev_radio);
        if (vp->vfirst) return;
        pvr2_v4l2_destroy_no_lock(vp);
 }
@@ -1251,18 +1266,13 @@
                               struct pvr2_v4l2 *vp,
                               int v4l_type)
 {
-#if 0
        struct usb_device *usbdev;
-#endif
        int mindevnum;
        int unit_number;
        int *nr_ptr = NULL;
        dip->v4lp = vp;
 
-#if 0
        usbdev = pvr2_hdw_get_dev(vp->channel.mc_head->hdw);
-#endif
-
        dip->v4l_type = v4l_type;
        switch (v4l_type) {
        case VFL_TYPE_GRABBER:
@@ -1303,6 +1313,7 @@
        if (nr_ptr && (unit_number >= 0) && (unit_number < PVR_NUM)) {
                mindevnum = nr_ptr[unit_number];
        }
+       dip->devbase.parent = &usbdev->dev;
        if ((video_register_device(&dip->devbase,
                                   dip->v4l_type, mindevnum) < 0) &&
            (video_register_device(&dip->devbase,


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/8b198ce54889497aede2d4af035d3b6484025835

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to