summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-12-16 18:29:03 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-16 18:29:03 -0200
commit44588fb487e94e330e9ea9da744cb35e7f14dc96 (patch)
treed1bcfa03e7ac8c5d1d327aca0023f43ed3f76651 /linux/drivers/media/dvb/cinergyT2/cinergyT2.c
parent35098755c90373eb932f02f71ec986e9d4a6f49b (diff)
downloadmediapointer-dvb-s2-44588fb487e94e330e9ea9da744cb35e7f14dc96.tar.gz
mediapointer-dvb-s2-44588fb487e94e330e9ea9da744cb35e7f14dc96.tar.bz2
Several stuff backported from 2.6.19-git series
From: Mauro Carvalho Chehab <mchehab@infradead.org> - INIT_WORK replaced by INIT_DELAYED_WORK - struct work_struct replaced by struct delayed_work - callback parameters also changed - SLAB_KERNEL replaced by GFP_KERNEL - linux/suspend.h replaced by linux/freezer.h - on cpia: INIT_WORK replaced by INIT_WORK_NAR - file->f_dentry->d_inode replaced by file->f_path.dentry->d_inode Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/dvb/cinergyT2/cinergyT2.c')
-rw-r--r--linux/drivers/media/dvb/cinergyT2/cinergyT2.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
index 7c655b705..a33f82910 100644
--- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -144,7 +144,11 @@ struct cinergyt2 {
struct dvbt_set_parameters_msg param;
struct dvbt_get_status_msg status;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
struct work_struct query_work;
+#else
+ struct delayed_work query_work;
+#endif
wait_queue_head_t poll_wq;
int pending_fe_events;
@@ -158,7 +162,11 @@ struct cinergyt2 {
#ifdef ENABLE_RC
struct input_dev *rc_input_dev;
char phys[64];
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
struct work_struct rc_query_work;
+#else
+ struct delayed_work rc_query_work;
+#endif
int rc_input_event;
u32 rc_last_code;
unsigned long last_event_jiffies;
@@ -311,7 +319,7 @@ static int cinergyt2_alloc_stream_urbs (struct cinergyt2 *cinergyt2)
int i;
cinergyt2->streambuf = usb_buffer_alloc(cinergyt2->udev, STREAM_URB_COUNT*STREAM_BUF_SIZE,
- SLAB_KERNEL, &cinergyt2->streambuf_dmahandle);
+ GFP_KERNEL, &cinergyt2->streambuf_dmahandle);
if (!cinergyt2->streambuf) {
dprintk(1, "failed to alloc consistent stream memory area, bailing out!\n");
return -ENOMEM;
@@ -747,9 +755,18 @@ static struct dvb_device cinergyt2_fe_template = {
#ifdef ENABLE_RC
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
static void cinergyt2_query_rc (void *data)
+#else
+static void cinergyt2_query_rc (struct work_struct *work)
+#endif
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
struct cinergyt2 *cinergyt2 = data;
+#else
+ struct cinergyt2 *cinergyt2 =
+ container_of(work, struct cinergyt2, rc_query_work.work);
+#endif
char buf[1] = { CINERGYT2_EP1_GET_RC_EVENTS };
struct cinergyt2_rc_event rc_events[12];
int n, len, i;
@@ -833,7 +850,11 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2)
strlcat(cinergyt2->phys, "/input0", sizeof(cinergyt2->phys));
cinergyt2->rc_input_event = KEY_MAX;
cinergyt2->rc_last_code = ~0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
INIT_WORK(&cinergyt2->rc_query_work, cinergyt2_query_rc, cinergyt2);
+#else
+ INIT_DELAYED_WORK(&cinergyt2->rc_query_work, cinergyt2_query_rc);
+#endif
input_dev->name = DRIVER_NAME " remote control";
input_dev->phys = cinergyt2->phys;
@@ -880,9 +901,18 @@ static inline void cinergyt2_resume_rc(struct cinergyt2 *cinergyt2) { }
#endif /* ENABLE_RC */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
static void cinergyt2_query (void *data)
+#else
+static void cinergyt2_query (struct work_struct *work)
+#endif
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
struct cinergyt2 *cinergyt2 = (struct cinergyt2 *) data;
+#else
+ struct cinergyt2 *cinergyt2 =
+ container_of(work, struct cinergyt2, query_work.work);
+#endif
char cmd [] = { CINERGYT2_EP1_GET_TUNER_STATUS };
struct dvbt_get_status_msg *s = &cinergyt2->status;
uint8_t lock_bits;
@@ -926,7 +956,11 @@ static int cinergyt2_probe (struct usb_interface *intf,
mutex_init(&cinergyt2->sem);
init_waitqueue_head (&cinergyt2->poll_wq);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
INIT_WORK(&cinergyt2->query_work, cinergyt2_query, cinergyt2);
+#else
+ INIT_DELAYED_WORK(&cinergyt2->query_work, cinergyt2_query);
+#endif
cinergyt2->udev = interface_to_usbdev(intf);
cinergyt2->param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;