summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-06-15 07:52:42 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-04 14:56:33 +0400
commitad2618393168a72f079265023ddc68f2a89ccc9f (patch)
tree2c5e44ec71f0b8d2ffc86159672da9e500de4f24 /drivers/media
parent6e3a5daa6ee7a0eae3b2161ed4783fee547654c2 (diff)
downloadlinux-ad2618393168a72f079265023ddc68f2a89ccc9f.tar.xz
[media] dvb_usb_v2: simplify remote init/exit logic
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb_usb.h1
-rw-r--r--drivers/media/dvb/dvb-usb/dvb_usb_init.c11
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb.h b/drivers/media/dvb/dvb-usb/dvb_usb.h
index a972de6f8486..62097f38bb16 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb_usb.h
@@ -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;
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_init.c b/drivers/media/dvb/dvb-usb/dvb_usb_init.c
index cea334331508..5da4233501f0 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb_init.c
+++ b/drivers/media/dvb/dvb-usb/dvb_usb_init.c
@@ -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;
@@ -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);
@@ -200,13 +200,14 @@ err:
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;
}