summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c
diff options
context:
space:
mode:
authorPatrick Boettcher <devnull@localhost>2004-12-29 20:27:55 +0000
committerPatrick Boettcher <devnull@localhost>2004-12-29 20:27:55 +0000
commitbfca54e0f0214c6c63dc8abdfe32b78a5d519285 (patch)
treef151fdfa1f0237e323a4fb20bbe9375a60870c5c /linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c
parent30205db98dfe86e6793fe1eb27acda2072264062 (diff)
downloadmediapointer-dvb-s2-bfca54e0f0214c6c63dc8abdfe32b78a5d519285.tar.gz
mediapointer-dvb-s2-bfca54e0f0214c6c63dc8abdfe32b78a5d519285.tar.bz2
init state added, clean init and exit of every part
Diffstat (limited to 'linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c')
-rw-r--r--linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c
index fc670c499..82931c0c9 100644
--- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c
+++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c
@@ -173,13 +173,19 @@ int dibusb_remote_init(struct usb_dibusb *dib)
info("schedule remote query interval to %d msecs.",rc_query_interval);
schedule_delayed_work(&dib->rc_query_work,msecs_to_jiffies(rc_query_interval));
+
+ dib->init_state |= DIBUSB_STATE_REMOTE;
+
return 0;
}
int dibusb_remote_exit(struct usb_dibusb *dib)
{
- cancel_delayed_work(&dib->rc_query_work);
- flush_scheduled_work();
- input_unregister_device(&dib->rc_input_dev);
+ if (dib->init_state & DIBUSB_STATE_REMOTE) {
+ cancel_delayed_work(&dib->rc_query_work);
+ flush_scheduled_work();
+ input_unregister_device(&dib->rc_input_dev);
+ }
+ dib->init_state &= ~DIBUSB_STATE_REMOTE;
return 0;
}