aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-06-10 08:16:25 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 10:03:57 -0400
commita28fbd04facbffe9374f25c3a19c54ce4f186361 (patch)
tree6f5830d257ac19a82f3a7790cf9e714f1eba651c /drivers/media/usb
parentd66de790c77b98589b93cb327bde2cddd2a4c2cc (diff)
[media] pvrusb2: use v4l2_dev instead of the deprecated parent field
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-hdw.c4
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-hdw.h4
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-v4l2.c7
3 files changed, 12 insertions, 3 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
index d32920929660..c4d51d78f837 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
@@ -2704,6 +2704,10 @@ static void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw)
2704 pvr2_hdw_render_useless(hdw); 2704 pvr2_hdw_render_useless(hdw);
2705} 2705}
2706 2706
2707void pvr2_hdw_set_v4l2_dev(struct pvr2_hdw *hdw, struct video_device *vdev)
2708{
2709 vdev->v4l2_dev = &hdw->v4l2_dev;
2710}
2707 2711
2708/* Destroy hardware interaction structure */ 2712/* Destroy hardware interaction structure */
2709void pvr2_hdw_destroy(struct pvr2_hdw *hdw) 2713void pvr2_hdw_destroy(struct pvr2_hdw *hdw)
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.h b/drivers/media/usb/pvrusb2/pvrusb2-hdw.h
index 1a135cf6ae4e..41847076f51a 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.h
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.h
@@ -22,6 +22,7 @@
22 22
23#include <linux/usb.h> 23#include <linux/usb.h>
24#include <linux/videodev2.h> 24#include <linux/videodev2.h>
25#include <media/v4l2-dev.h>
25#include "pvrusb2-io.h" 26#include "pvrusb2-io.h"
26#include "pvrusb2-ctrl.h" 27#include "pvrusb2-ctrl.h"
27 28
@@ -138,6 +139,9 @@ const char *pvr2_hdw_get_device_identifier(struct pvr2_hdw *);
138/* Called when hardware has been unplugged */ 139/* Called when hardware has been unplugged */
139void pvr2_hdw_disconnect(struct pvr2_hdw *); 140void pvr2_hdw_disconnect(struct pvr2_hdw *);
140 141
142/* Sets v4l2_dev of a video_device struct */
143void pvr2_hdw_set_v4l2_dev(struct pvr2_hdw *, struct video_device *);
144
141/* Get the number of defined controls */ 145/* Get the number of defined controls */
142unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *); 146unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *);
143 147
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index 82f619ba5cca..d77069e12dc4 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -31,6 +31,7 @@
31#include <linux/videodev2.h> 31#include <linux/videodev2.h>
32#include <linux/module.h> 32#include <linux/module.h>
33#include <media/v4l2-dev.h> 33#include <media/v4l2-dev.h>
34#include <media/v4l2-device.h>
34#include <media/v4l2-common.h> 35#include <media/v4l2-common.h>
35#include <media/v4l2-ioctl.h> 36#include <media/v4l2-ioctl.h>
36 37
@@ -870,8 +871,8 @@ static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
870static void pvr2_v4l2_dev_disassociate_parent(struct pvr2_v4l2_dev *dip) 871static void pvr2_v4l2_dev_disassociate_parent(struct pvr2_v4l2_dev *dip)
871{ 872{
872 if (!dip) return; 873 if (!dip) return;
873 if (!dip->devbase.parent) return; 874 if (!dip->devbase.v4l2_dev->dev) return;
874 dip->devbase.parent = NULL; 875 dip->devbase.v4l2_dev->dev = NULL;
875 device_move(&dip->devbase.dev, NULL, DPM_ORDER_NONE); 876 device_move(&dip->devbase.dev, NULL, DPM_ORDER_NONE);
876} 877}
877 878
@@ -1321,7 +1322,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1321 if (nr_ptr && (unit_number >= 0) && (unit_number < PVR_NUM)) { 1322 if (nr_ptr && (unit_number >= 0) && (unit_number < PVR_NUM)) {
1322 mindevnum = nr_ptr[unit_number]; 1323 mindevnum = nr_ptr[unit_number];
1323 } 1324 }
1324 dip->devbase.parent = &usbdev->dev; 1325 pvr2_hdw_set_v4l2_dev(hdw, &dip->devbase);
1325 if ((video_register_device(&dip->devbase, 1326 if ((video_register_device(&dip->devbase,
1326 dip->v4l_type, mindevnum) < 0) && 1327 dip->v4l_type, mindevnum) < 0) &&
1327 (video_register_device(&dip->devbase, 1328 (video_register_device(&dip->devbase,