tree 705fc3f433180d96e357bdcf4814408169367018
parent 62703b9d72114a563488cd4be6d0827618395589
author Patrick Boettcher <[EMAIL PROTECTED]> Sat, 10 Sep 2005 03:02:47 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sat, 10 Sep 2005 03:57:41 -0700

[PATCH] dvb: usb: core: change dvb_usb_device_init() API

Change the init call to optionally return the new dvb_usb_device directly.

Signed-off-by: Patrick Boettcher <[EMAIL PROTECTED]>
Signed-off-by: Johannes Stezenbach <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/media/dvb/dvb-usb/a800.c         |    2 +-
 drivers/media/dvb/dvb-usb/cxusb.c        |    2 +-
 drivers/media/dvb/dvb-usb/dibusb-mb.c    |    6 +++---
 drivers/media/dvb/dvb-usb/dibusb-mc.c    |    2 +-
 drivers/media/dvb/dvb-usb/digitv.c       |    2 +-
 drivers/media/dvb/dvb-usb/dtt200u.c      |    4 ++--
 drivers/media/dvb/dvb-usb/dvb-usb-ids.h  |    3 +++
 drivers/media/dvb/dvb-usb/dvb-usb-init.c |    7 ++++++-
 drivers/media/dvb/dvb-usb/dvb-usb.h      |    4 ++--
 drivers/media/dvb/dvb-usb/nova-t-usb2.c  |    2 +-
 drivers/media/dvb/dvb-usb/umt-010.c      |    2 +-
 drivers/media/dvb/dvb-usb/vp702x.c       |    2 +-
 drivers/media/dvb/dvb-usb/vp7045.c       |    2 +-
 13 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c
--- a/drivers/media/dvb/dvb-usb/a800.c
+++ b/drivers/media/dvb/dvb-usb/a800.c
@@ -90,7 +90,7 @@ static struct dvb_usb_properties a800_pr
 static int a800_probe(struct usb_interface *intf,
                const struct usb_device_id *id)
 {
-       return dvb_usb_device_init(intf,&a800_properties,THIS_MODULE);
+       return dvb_usb_device_init(intf,&a800_properties,THIS_MODULE,NULL);
 }
 
 /* do not change the order of the ID table */
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c 
b/drivers/media/dvb/dvb-usb/cxusb.c
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -211,7 +211,7 @@ static struct dvb_usb_properties cxusb_p
 static int cxusb_probe(struct usb_interface *intf,
                const struct usb_device_id *id)
 {
-       return dvb_usb_device_init(intf,&cxusb_properties,THIS_MODULE);
+       return dvb_usb_device_init(intf,&cxusb_properties,THIS_MODULE,NULL);
 }
 
 static struct usb_device_id cxusb_table [] = {
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c 
b/drivers/media/dvb/dvb-usb/dibusb-mb.c
--- a/drivers/media/dvb/dvb-usb/dibusb-mb.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c
@@ -86,9 +86,9 @@ static struct dvb_usb_properties dibusb2
 static int dibusb_probe(struct usb_interface *intf,
                const struct usb_device_id *id)
 {
-       if (dvb_usb_device_init(intf,&dibusb1_1_properties,THIS_MODULE) == 0 ||
-               
dvb_usb_device_init(intf,&dibusb1_1_an2235_properties,THIS_MODULE) == 0 ||
-               dvb_usb_device_init(intf,&dibusb2_0b_properties,THIS_MODULE) == 
0)
+       if (dvb_usb_device_init(intf,&dibusb1_1_properties,THIS_MODULE,NULL) == 
0 ||
+               
dvb_usb_device_init(intf,&dibusb1_1_an2235_properties,THIS_MODULE,NULL) == 0 ||
+               
dvb_usb_device_init(intf,&dibusb2_0b_properties,THIS_MODULE,NULL) == 0)
                return 0;
 
        return -EINVAL;
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c 
b/drivers/media/dvb/dvb-usb/dibusb-mc.c
--- a/drivers/media/dvb/dvb-usb/dibusb-mc.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c
@@ -20,7 +20,7 @@ static struct dvb_usb_properties dibusb_
 static int dibusb_mc_probe(struct usb_interface *intf,
                const struct usb_device_id *id)
 {
-       return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE);
+       return dvb_usb_device_init(intf,&dibusb_mc_properties,THIS_MODULE,NULL);
 }
 
 /* do not change the order of the ID table */
diff --git a/drivers/media/dvb/dvb-usb/digitv.c 
b/drivers/media/dvb/dvb-usb/digitv.c
--- a/drivers/media/dvb/dvb-usb/digitv.c
+++ b/drivers/media/dvb/dvb-usb/digitv.c
@@ -173,7 +173,7 @@ static struct dvb_usb_properties digitv_
 static int digitv_probe(struct usb_interface *intf,
                const struct usb_device_id *id)
 {
-       return dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE);
+       return dvb_usb_device_init(intf,&digitv_properties,THIS_MODULE,NULL);
 }
 
 static struct usb_device_id digitv_table [] = {
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c 
b/drivers/media/dvb/dvb-usb/dtt200u.c
--- a/drivers/media/dvb/dvb-usb/dtt200u.c
+++ b/drivers/media/dvb/dvb-usb/dtt200u.c
@@ -98,8 +98,8 @@ static struct dvb_usb_properties wt220u_
 static int dtt200u_usb_probe(struct usb_interface *intf,
                const struct usb_device_id *id)
 {
-       if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE) == 0 ||
-               dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE) == 0)
+       if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL) == 0 
||
+               dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) 
== 0)
                return 0;
 
        return -ENODEV;
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h 
b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -27,6 +27,7 @@
 #define USB_VID_KWORLD                                         0xeb2a
 #define USB_VID_KYE                                                    0x0458
 #define USB_VID_MEDION                                         0x1660
+#define USB_VID_PINNACLE                                       0x2304
 #define USB_VID_VISIONPLUS                                     0x13d3
 #define USB_VID_TWINHAN                                                0x1822
 #define USB_VID_ULTIMA_ELECTRONIC                      0x05d8
@@ -88,5 +89,7 @@
 #define USB_PID_MEDION_MD95700                         0x0932
 #define USB_PID_KYE_DVB_T_COLD                         0x701e
 #define USB_PID_KYE_DVB_T_WARM                         0x701f
+#define USB_PID_PCTV_200E                                      0x020e
+#define USB_PID_PCTV_400E                                      0x020f
 
 #endif
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c 
b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
--- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
@@ -128,7 +128,9 @@ static struct dvb_usb_device_description
 /*
  * USB
  */
-int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties 
*props, struct module *owner)
+
+int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties
+               *props, struct module *owner,struct dvb_usb_device **du)
 {
        struct usb_device *udev = interface_to_usbdev(intf);
        struct dvb_usb_device *d = NULL;
@@ -170,6 +172,9 @@ int dvb_usb_device_init(struct usb_inter
 
                usb_set_intfdata(intf, d);
 
+               if (du != NULL)
+                       *du = d;
+
                ret = dvb_usb_init(d);
        }
 
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h 
b/drivers/media/dvb/dvb-usb/dvb-usb.h
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -127,7 +127,7 @@ struct dvb_usb_device;
  *  helper functions.
  *
  * @urb: describes the kind of USB transfer used for MPEG2-TS-streaming.
- *  Currently only BULK is implemented
+ *  (BULK or ISOC)
  *
  * @num_device_descs: number of struct dvb_usb_device_description in @devices
  * @devices: array of struct dvb_usb_device_description compatibles with these
@@ -310,7 +310,7 @@ struct dvb_usb_device {
        void *priv;
 };
 
-extern int dvb_usb_device_init(struct usb_interface *, struct 
dvb_usb_properties *, struct module *);
+extern int dvb_usb_device_init(struct usb_interface *, struct 
dvb_usb_properties *, struct module *, struct dvb_usb_device **);
 extern void dvb_usb_device_exit(struct usb_interface *);
 
 /* the generic read/write method for device control */
diff --git a/drivers/media/dvb/dvb-usb/nova-t-usb2.c 
b/drivers/media/dvb/dvb-usb/nova-t-usb2.c
--- a/drivers/media/dvb/dvb-usb/nova-t-usb2.c
+++ b/drivers/media/dvb/dvb-usb/nova-t-usb2.c
@@ -144,7 +144,7 @@ static struct dvb_usb_properties nova_t_
 static int nova_t_probe(struct usb_interface *intf,
                const struct usb_device_id *id)
 {
-       return dvb_usb_device_init(intf,&nova_t_properties,THIS_MODULE);
+       return dvb_usb_device_init(intf,&nova_t_properties,THIS_MODULE,NULL);
 }
 
 /* do not change the order of the ID table */
diff --git a/drivers/media/dvb/dvb-usb/umt-010.c 
b/drivers/media/dvb/dvb-usb/umt-010.c
--- a/drivers/media/dvb/dvb-usb/umt-010.c
+++ b/drivers/media/dvb/dvb-usb/umt-010.c
@@ -77,7 +77,7 @@ static struct dvb_usb_properties umt_pro
 static int umt_probe(struct usb_interface *intf,
                const struct usb_device_id *id)
 {
-       if (dvb_usb_device_init(intf,&umt_properties,THIS_MODULE) == 0)
+       if (dvb_usb_device_init(intf,&umt_properties,THIS_MODULE,NULL) == 0)
                return 0;
        return -EINVAL;
 }
diff --git a/drivers/media/dvb/dvb-usb/vp702x.c 
b/drivers/media/dvb/dvb-usb/vp702x.c
--- a/drivers/media/dvb/dvb-usb/vp702x.c
+++ b/drivers/media/dvb/dvb-usb/vp702x.c
@@ -197,7 +197,7 @@ static int vp702x_usb_probe(struct usb_i
        usb_clear_halt(udev,usb_sndctrlpipe(udev,0));
        usb_clear_halt(udev,usb_rcvctrlpipe(udev,0));
 
-       return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE);
+       return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE,NULL);
 }
 
 static struct usb_device_id vp702x_usb_table [] = {
diff --git a/drivers/media/dvb/dvb-usb/vp7045.c 
b/drivers/media/dvb/dvb-usb/vp7045.c
--- a/drivers/media/dvb/dvb-usb/vp7045.c
+++ b/drivers/media/dvb/dvb-usb/vp7045.c
@@ -199,7 +199,7 @@ static struct dvb_usb_properties vp7045_
 static int vp7045_usb_probe(struct usb_interface *intf,
                const struct usb_device_id *id)
 {
-       return dvb_usb_device_init(intf,&vp7045_properties,THIS_MODULE);
+       return dvb_usb_device_init(intf,&vp7045_properties,THIS_MODULE,NULL);
 }
 
 static struct usb_device_id vp7045_usb_table [] = {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to