diff options
Diffstat (limited to 'linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c index 5c80bad4e..63f6242cf 100644 --- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c +++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c @@ -29,6 +29,7 @@ int dvb_usb_exit(struct dvb_usb_device *d) dvb_usb_urb_exit(d); deb_info("init_state should be zero now: %x\n",d->init_state); d->init_state = DVB_USB_STATE_INIT; + kfree(d->priv); kfree(d); return 0; } @@ -51,8 +52,17 @@ static int dvb_usb_init(struct dvb_usb_device *d) } if ((d->udev->speed == USB_SPEED_FULL && d->props.caps & DVB_USB_HAS_PID_FILTER) || - (d->props.caps & DVB_USB_NEED_PID_FILTERING)) + (d->props.caps & DVB_USB_NEED_PID_FILTERING)) { + info("will use the device's hw PID filter."); d->pid_filtering = 1; + } else { + info("will pass the complete MPEG2 transport stream to the demuxer."); + d->pid_filtering = 0; + } + + + if (d->props.power_ctrl) + d->props.power_ctrl(d,1); if ((ret = dvb_usb_urb_init(d)) || (ret = dvb_usb_dvb_init(d)) || @@ -65,6 +75,9 @@ static int dvb_usb_init(struct dvb_usb_device *d) if ((ret = dvb_usb_remote_init(d))) err("could not initialize remote control."); + if (d->props.power_ctrl) + d->props.power_ctrl(d,0); + return 0; } @@ -119,8 +132,7 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties *p int ret = -ENOMEM,cold=0; if ((desc = dvb_usb_find_device(udev,props,&cold)) == NULL) { - err("something went very wrong, " - "unknown product ID: %.4x",le16_to_cpu(udev->descriptor.idProduct)); + deb_err("something went very wrong, device was not found in current device list - let's see what comes next.\n"); return -ENODEV; } @@ -141,10 +153,15 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties *p d->desc = desc; d->owner = owner; - /* store parameters to structures */ -/* d->rc_query_interval = rc_query_interval; - d->pid_parse = pid_parse; - d->rc_key_repeat_count = rc_key_repeat_count;*/ + if (d->props.size_of_priv > 0) { + d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL); + if (d->priv == NULL) { + err("no memory for priv in 'struct dvb_usb_device'"); + kfree(d); + return -ENOMEM; + } + memset(d->priv,0,d->props.size_of_priv); + } usb_set_intfdata(intf, d); |