Skip to content

Commit

Permalink
[PATCH] dvb: usb: core: change dvb_usb_device_init() API
Browse files Browse the repository at this point in the history
Change the init call to optionally return the new dvb_usb_device directly.

Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Patrick Boettcher authored and Linus Torvalds committed Sep 9, 2005
1 parent 62703b9 commit 47dc3d6
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/a800.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static struct dvb_usb_properties a800_properties;
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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/cxusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static struct dvb_usb_properties cxusb_properties;
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 [] = {
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/dvb/dvb-usb/dibusb-mb.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ static struct dvb_usb_properties dibusb2_0b_properties;
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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/dibusb-mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static struct dvb_usb_properties dibusb_mc_properties;
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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/digitv.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static struct dvb_usb_properties digitv_properties;
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 [] = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/dvb/dvb-usb/dtt200u.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ static struct dvb_usb_properties wt220u_properties;
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;
Expand Down
3 changes: 3 additions & 0 deletions drivers/media/dvb/dvb-usb/dvb-usb-ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
7 changes: 6 additions & 1 deletion drivers/media/dvb/dvb-usb/dvb-usb-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ static struct dvb_usb_device_description * dvb_usb_find_device(struct usb_device
/*
* 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;
Expand Down Expand Up @@ -170,6 +172,9 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties *p

usb_set_intfdata(intf, d);

if (du != NULL)
*du = d;

ret = dvb_usb_init(d);
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/media/dvb/dvb-usb/dvb-usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/nova-t-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static struct dvb_usb_properties nova_t_properties;
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 */
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/umt-010.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static struct dvb_usb_properties umt_properties;
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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/vp702x.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static int vp702x_usb_probe(struct usb_interface *intf,
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 [] = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/vp7045.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static struct dvb_usb_properties vp7045_properties;
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 [] = {
Expand Down

0 comments on commit 47dc3d6

Please sign in to comment.