Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38248
b: refs/heads/master
c: a37ddce
h: refs/heads/master
v: v3
  • Loading branch information
Patrick Boettcher authored and Mauro Carvalho Chehab committed Oct 3, 2006
1 parent 321ca5e commit 9769cb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d57436040a7ff486fb90a82b6f542fbe275f624
refs/heads/master: a37ddced86b092f8f4fd8dc20d4f5dce2e7cc6d3
11 changes: 8 additions & 3 deletions trunk/drivers/media/dvb/dvb-usb/dvb-usb-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static int dvb_usb_init(struct dvb_usb_device *d)
if (d->priv == NULL) {
err("no memory for priv in 'struct dvb_usb_device'");
return -ENOMEM;
}
}
}

/* check the capabilities and set appropriate variables */
Expand Down Expand Up @@ -197,8 +197,13 @@ static struct dvb_usb_device_description * dvb_usb_find_device(struct usb_device

int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff)
{
if (d->powered == !onoff) {
d->powered = onoff;
if (onoff)
d->powered++;
else
d->powered--;

if (d->powered == 0 || (onoff && d->powered == 1)) { // when switching from 1 to 0 or from 0 to 1
deb_info("power control: %d\n", onoff);
if (d->props.power_ctrl)
return d->props.power_ctrl(d, onoff);
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/media/dvb/dvb-usb/dvb-usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ struct dvb_usb_adapter {
* @desc: pointer to the device's struct dvb_usb_device_description.
* @state: initialization and runtime state of the device.
*
* @powered: indicated whether the device is power or not.
* Powered is in/decremented for each call to modify the state.
* @udev: pointer to the device's struct usb_device.
*
* @usb_mutex: semaphore of USB control messages (reading needs two messages)
Expand Down

0 comments on commit 9769cb3

Please sign in to comment.