Skip to content

Commit

Permalink
[media] dvb_usb_v2: simplify remote init/exit logic
Browse files Browse the repository at this point in the history
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Aug 4, 2012
1 parent 6e3a5da commit ad26183
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion drivers/media/dvb/dvb-usb/dvb_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ struct dvb_usb_device {
#define DVB_USB_STATE_INIT 0x000
#define DVB_USB_STATE_I2C 0x001
#define DVB_USB_STATE_DVB 0x002
#define DVB_USB_STATE_REMOTE 0x004
int state;

int powered;
Expand Down
11 changes: 6 additions & 5 deletions drivers/media/dvb/dvb-usb/dvb_usb_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ static int dvb_usbv2_remote_init(struct dvb_usb_device *d)
int ret;
struct rc_dev *dev;

pr_debug("%s:\n", __func__);

if (dvb_usbv2_disable_rc_polling || !d->props->get_rc_config)
return 0;

Expand Down Expand Up @@ -190,8 +192,6 @@ static int dvb_usbv2_remote_init(struct dvb_usb_device *d)
msecs_to_jiffies(d->rc.interval));
}

d->state |= DVB_USB_STATE_REMOTE;

return 0;
err:
pr_debug("%s: failed=%d\n", __func__, ret);
Expand All @@ -200,13 +200,14 @@ static int dvb_usbv2_remote_init(struct dvb_usb_device *d)

static int dvb_usbv2_remote_exit(struct dvb_usb_device *d)
{
if (d->state & DVB_USB_STATE_REMOTE) {
pr_debug("%s:\n", __func__);

if (d->rc_dev) {
cancel_delayed_work_sync(&d->rc_query_work);
rc_unregister_device(d->rc_dev);
d->rc_dev = NULL;
}

d->state &= ~DVB_USB_STATE_REMOTE;

return 0;
}

Expand Down

0 comments on commit ad26183

Please sign in to comment.