aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/cinergyT2/cinergyT2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/cinergyT2/cinergyT2.c')
-rw-r--r--drivers/media/dvb/cinergyT2/cinergyT2.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c
index ff7d4f56ced3..9123147e376f 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -30,6 +30,7 @@
30#include <linux/input.h> 30#include <linux/input.h>
31#include <linux/dvb/frontend.h> 31#include <linux/dvb/frontend.h>
32#include <linux/mutex.h> 32#include <linux/mutex.h>
33#include <linux/mm.h>
33 34
34#include "dmxdev.h" 35#include "dmxdev.h"
35#include "dvb_demux.h" 36#include "dvb_demux.h"
@@ -127,7 +128,7 @@ struct cinergyt2 {
127 128
128 struct dvbt_set_parameters_msg param; 129 struct dvbt_set_parameters_msg param;
129 struct dvbt_get_status_msg status; 130 struct dvbt_get_status_msg status;
130 struct work_struct query_work; 131 struct delayed_work query_work;
131 132
132 wait_queue_head_t poll_wq; 133 wait_queue_head_t poll_wq;
133 int pending_fe_events; 134 int pending_fe_events;
@@ -141,7 +142,7 @@ struct cinergyt2 {
141#ifdef ENABLE_RC 142#ifdef ENABLE_RC
142 struct input_dev *rc_input_dev; 143 struct input_dev *rc_input_dev;
143 char phys[64]; 144 char phys[64];
144 struct work_struct rc_query_work; 145 struct delayed_work rc_query_work;
145 int rc_input_event; 146 int rc_input_event;
146 u32 rc_last_code; 147 u32 rc_last_code;
147 unsigned long last_event_jiffies; 148 unsigned long last_event_jiffies;
@@ -275,8 +276,7 @@ static void cinergyt2_free_stream_urbs (struct cinergyt2 *cinergyt2)
275 int i; 276 int i;
276 277
277 for (i=0; i<STREAM_URB_COUNT; i++) 278 for (i=0; i<STREAM_URB_COUNT; i++)
278 if (cinergyt2->stream_urb[i]) 279 usb_free_urb(cinergyt2->stream_urb[i]);
279 usb_free_urb(cinergyt2->stream_urb[i]);
280 280
281 usb_buffer_free(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE, 281 usb_buffer_free(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE,
282 cinergyt2->streambuf, cinergyt2->streambuf_dmahandle); 282 cinergyt2->streambuf, cinergyt2->streambuf_dmahandle);
@@ -287,7 +287,7 @@ static int cinergyt2_alloc_stream_urbs (struct cinergyt2 *cinergyt2)
287 int i; 287 int i;
288 288
289 cinergyt2->streambuf = usb_buffer_alloc(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE, 289 cinergyt2->streambuf = usb_buffer_alloc(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE,
290 SLAB_KERNEL, &cinergyt2->streambuf_dmahandle); 290 GFP_KERNEL, &cinergyt2->streambuf_dmahandle);
291 if (!cinergyt2->streambuf) { 291 if (!cinergyt2->streambuf) {
292 dprintk(1, "failed to alloc consistent stream memory area, bailing out!\n"); 292 dprintk(1, "failed to alloc consistent stream memory area, bailing out!\n");
293 return -ENOMEM; 293 return -ENOMEM;
@@ -320,8 +320,7 @@ static void cinergyt2_stop_stream_xfer (struct cinergyt2 *cinergyt2)
320 cinergyt2_control_stream_transfer(cinergyt2, 0); 320 cinergyt2_control_stream_transfer(cinergyt2, 0);
321 321
322 for (i=0; i<STREAM_URB_COUNT; i++) 322 for (i=0; i<STREAM_URB_COUNT; i++)
323 if (cinergyt2->stream_urb[i]) 323 usb_kill_urb(cinergyt2->stream_urb[i]);
324 usb_kill_urb(cinergyt2->stream_urb[i]);
325} 324}
326 325
327static int cinergyt2_start_stream_xfer (struct cinergyt2 *cinergyt2) 326static int cinergyt2_start_stream_xfer (struct cinergyt2 *cinergyt2)
@@ -724,9 +723,10 @@ static struct dvb_device cinergyt2_fe_template = {
724 723
725#ifdef ENABLE_RC 724#ifdef ENABLE_RC
726 725
727static void cinergyt2_query_rc (void *data) 726static void cinergyt2_query_rc (struct work_struct *work)
728{ 727{
729 struct cinergyt2 *cinergyt2 = data; 728 struct cinergyt2 *cinergyt2 =
729 container_of(work, struct cinergyt2, rc_query_work.work);
730 char buf[1] = { CINERGYT2_EP1_GET_RC_EVENTS }; 730 char buf[1] = { CINERGYT2_EP1_GET_RC_EVENTS };
731 struct cinergyt2_rc_event rc_events[12]; 731 struct cinergyt2_rc_event rc_events[12];
732 int n, len, i; 732 int n, len, i;
@@ -807,7 +807,7 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2)
807 strlcat(cinergyt2->phys, "/input0", sizeof(cinergyt2->phys)); 807 strlcat(cinergyt2->phys, "/input0", sizeof(cinergyt2->phys));
808 cinergyt2->rc_input_event = KEY_MAX; 808 cinergyt2->rc_input_event = KEY_MAX;
809 cinergyt2->rc_last_code = ~0; 809 cinergyt2->rc_last_code = ~0;
810 INIT_WORK(&cinergyt2->rc_query_work, cinergyt2_query_rc, cinergyt2); 810 INIT_DELAYED_WORK(&cinergyt2->rc_query_work, cinergyt2_query_rc);
811 811
812 input_dev->name = DRIVER_NAME " remote control"; 812 input_dev->name = DRIVER_NAME " remote control";
813 input_dev->phys = cinergyt2->phys; 813 input_dev->phys = cinergyt2->phys;
@@ -848,9 +848,10 @@ static inline void cinergyt2_resume_rc(struct cinergyt2 *cinergyt2) { }
848 848
849#endif /* ENABLE_RC */ 849#endif /* ENABLE_RC */
850 850
851static void cinergyt2_query (void *data) 851static void cinergyt2_query (struct work_struct *work)
852{ 852{
853 struct cinergyt2 *cinergyt2 = (struct cinergyt2 *) data; 853 struct cinergyt2 *cinergyt2 =
854 container_of(work, struct cinergyt2, query_work.work);
854 char cmd [] = { CINERGYT2_EP1_GET_TUNER_STATUS }; 855 char cmd [] = { CINERGYT2_EP1_GET_TUNER_STATUS };
855 struct dvbt_get_status_msg *s = &cinergyt2->status; 856 struct dvbt_get_status_msg *s = &cinergyt2->status;
856 uint8_t lock_bits; 857 uint8_t lock_bits;
@@ -894,7 +895,7 @@ static int cinergyt2_probe (struct usb_interface *intf,
894 895
895 mutex_init(&cinergyt2->sem); 896 mutex_init(&cinergyt2->sem);
896 init_waitqueue_head (&cinergyt2->poll_wq); 897 init_waitqueue_head (&cinergyt2->poll_wq);
897 INIT_WORK(&cinergyt2->query_work, cinergyt2_query, cinergyt2); 898 INIT_DELAYED_WORK(&cinergyt2->query_work, cinergyt2_query);
898 899
899 cinergyt2->udev = interface_to_usbdev(intf); 900 cinergyt2->udev = interface_to_usbdev(intf);
900 cinergyt2->param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS; 901 cinergyt2->param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;