diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-16 18:29:03 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-16 18:29:03 -0200 |
commit | 44588fb487e94e330e9ea9da744cb35e7f14dc96 (patch) | |
tree | d1bcfa03e7ac8c5d1d327aca0023f43ed3f76651 /linux/drivers | |
parent | 35098755c90373eb932f02f71ec986e9d4a6f49b (diff) | |
download | mediapointer-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')
20 files changed, 249 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/b2c2/flexcop-pci.c b/linux/drivers/media/dvb/b2c2/flexcop-pci.c index e6362f304..648f319b2 100644 --- a/linux/drivers/media/dvb/b2c2/flexcop-pci.c +++ b/linux/drivers/media/dvb/b2c2/flexcop-pci.c @@ -63,7 +63,11 @@ struct flexcop_pci { unsigned long last_irq; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct work_struct irq_check_work; +#else + struct delayed_work irq_check_work; +#endif struct flexcop_device *fc_dev; }; @@ -97,9 +101,18 @@ static int flexcop_pci_write_ibi_reg(struct flexcop_device *fc, flexcop_ibi_regi return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void flexcop_pci_irq_check_work(void *data) +#else +static void flexcop_pci_irq_check_work(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct flexcop_pci *fc_pci = data; +#else + struct flexcop_pci *fc_pci = + container_of(work, struct flexcop_pci, irq_check_work.work); +#endif struct flexcop_device *fc = fc_pci->fc_dev; flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714); @@ -375,7 +388,11 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e if ((ret = flexcop_pci_dma_init(fc_pci)) != 0) goto err_fc_exit; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work, fc_pci); +#else + INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work); +#endif return ret; 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; diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c index 52008bc96..fc65d9a25 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -34,7 +34,12 @@ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/list.h> +#include "compat.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #include <linux/suspend.h> +#else +#include <linux/freezer.h> +#endif #include <linux/jiffies.h> #include <asm/processor.h> diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c index 884ce0402..3e94e6cf9 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_net.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c @@ -130,6 +130,9 @@ struct dvb_net_priv { int in_use; struct net_device_stats stats; u16 pid; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + struct net_device *net; +#endif struct dvb_net *host; struct dmx_demux *demux; struct dmx_section_feed *secfeed; @@ -1130,10 +1133,20 @@ static int dvb_set_mc_filter (struct net_device *dev, struct dev_mc_list *mc) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void wq_set_multicast_list (void *data) +#else +static void wq_set_multicast_list (struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct net_device *dev = data; struct dvb_net_priv *priv = dev->priv; +#else + struct dvb_net_priv *priv = + container_of(work, struct dvb_net_priv, set_multicast_list_wq); + struct net_device *dev = priv->net; +#endif dvb_net_feed_stop(dev); priv->rx_mode = RX_MODE_UNI; @@ -1182,9 +1195,19 @@ static void dvb_net_set_multicast_list (struct net_device *dev) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void wq_restart_net_feed (void *data) +#else +static void wq_restart_net_feed (struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct net_device *dev = data; +#else + struct dvb_net_priv *priv = + container_of(work, struct dvb_net_priv, restart_net_feed_wq); + struct net_device *dev = priv->net; +#endif if (netif_running(dev)) { dvb_net_feed_stop(dev); @@ -1291,6 +1314,9 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) dvbnet->device[if_num] = net; priv = net->priv; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + priv->net = net; +#endif priv->demux = dvbnet->demux; priv->pid = pid; priv->rx_mode = RX_MODE_UNI; @@ -1299,8 +1325,13 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) priv->feedtype = feedtype; reset_ule(priv); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net); INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net); +#else + INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list); + INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed); +#endif mutex_init(&priv->mutex); net->base_addr = pid; diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c index 5fbb70c80..1a86adbfa 100644 --- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c +++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c @@ -19,9 +19,18 @@ * * TODO: Fix the repeat rate of the input device. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void dvb_usb_read_remote_control(void *data) +#else +static void dvb_usb_read_remote_control(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct dvb_usb_device *d = data; +#else + struct dvb_usb_device *d = + container_of(work, struct dvb_usb_device, rc_query_work.work); +#endif u32 event; int state; @@ -145,7 +154,11 @@ int dvb_usb_remote_init(struct dvb_usb_device *d) d->rc_input_dev = input_dev; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&d->rc_query_work, dvb_usb_read_remote_control, d); +#else + INIT_DELAYED_WORK(&d->rc_query_work, dvb_usb_read_remote_control); +#endif info("schedule remote query interval to %d msecs.", d->props.rc_interval); schedule_delayed_work(&d->rc_query_work,msecs_to_jiffies(d->props.rc_interval)); diff --git a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h index 883496c00..6ec8e4510 100644 --- a/linux/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb.h @@ -380,7 +380,11 @@ struct dvb_usb_device { /* remote control */ struct input_dev *rc_input_dev; char rc_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 u32 last_event; int last_state; diff --git a/linux/drivers/media/video/compat_ioctl32.c b/linux/drivers/media/video/compat_ioctl32.c index ea5efbd64..e0d6500f4 100644 --- a/linux/drivers/media/video/compat_ioctl32.c +++ b/linux/drivers/media/video/compat_ioctl32.c @@ -169,7 +169,11 @@ static int native_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ret = file->f_op->unlocked_ioctl(file, cmd, arg); else if (file->f_op->ioctl) { lock_kernel(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ret = file->f_op->ioctl(file->f_dentry->d_inode, file, cmd, arg); +#else + ret = file->f_op->ioctl(file->f_path.dentry->d_inode, file, cmd, arg); +#endif unlock_kernel(); } diff --git a/linux/drivers/media/video/cpia_pp.c b/linux/drivers/media/video/cpia_pp.c index 41f4b8d17..26e7e6d5b 100644 --- a/linux/drivers/media/video/cpia_pp.c +++ b/linux/drivers/media/video/cpia_pp.c @@ -82,6 +82,10 @@ struct pp_cam_entry { struct pardevice *pdev; struct parport *port; struct work_struct cb_task; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + void (*cb_func)(void *cbdata); + void *cb_data; +#endif int open_count; wait_queue_head_t wq_stream; /* image state flags */ @@ -130,6 +134,22 @@ static void cpia_parport_disable_irq( struct parport *port ) { #define PARPORT_CHUNK_SIZE PAGE_SIZE +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) +static void cpia_pp_run_callback(struct work_struct *work) +{ + void (*cb_func)(void *cbdata); + void *cb_data; + struct pp_cam_entry *cam; + + cam = container_of(work, struct pp_cam_entry, cb_task); + cb_func = cam->cb_func; + cb_data = cam->cb_data; + work_release(work); + + cb_func(cb_data); +} + +#endif /**************************************************************************** * * CPiA-specific low-level parport functions for nibble uploads @@ -664,7 +684,13 @@ static int cpia_pp_registerCallback(void *privdata, void (*cb)(void *cbdata), vo int retval = 0; if(cam->port->irq != PARPORT_IRQ_NONE) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&cam->cb_task, cb, cbdata); +#else + cam->cb_func = cb; + cam->cb_data = cbdata; + INIT_WORK_NAR(&cam->cb_task, cpia_pp_run_callback); +#endif } else { retval = -1; } diff --git a/linux/drivers/media/video/cx88/cx88-input.c b/linux/drivers/media/video/cx88/cx88-input.c index a5e4b7b50..6c712ecdd 100644 --- a/linux/drivers/media/video/cx88/cx88-input.c +++ b/linux/drivers/media/video/cx88/cx88-input.c @@ -146,9 +146,17 @@ static void ir_timer(unsigned long data) schedule_work(&ir->work); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void cx88_ir_work(void *data) +#else +static void cx88_ir_work(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct cx88_IR *ir = data; +#else + struct cx88_IR *ir = container_of(work, struct cx88_IR, work); +#endif unsigned long timeout; cx88_ir_handle_key(ir); @@ -159,7 +167,11 @@ static void cx88_ir_work(void *data) static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir) { if (ir->polling) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&ir->work, cx88_ir_work, ir); +#else + INIT_WORK(&ir->work, cx88_ir_work); +#endif init_timer(&ir->timer); ir->timer.function = ir_timer; ir->timer.data = (unsigned long)ir; diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c index a5a0fa83e..95566ff19 100644 --- a/linux/drivers/media/video/ir-kbd-i2c.c +++ b/linux/drivers/media/video/ir-kbd-i2c.c @@ -269,9 +269,17 @@ static void ir_timer(unsigned long data) schedule_work(&ir->work); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void ir_work(void *data) +#else +static void ir_work(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct IR_i2c *ir = data; +#else + struct IR_i2c *ir = container_of(work, struct IR_i2c, work); +#endif ir_key_poll(ir); mod_timer(&ir->timer, jiffies+HZ/10); } @@ -412,7 +420,11 @@ static int ir_attach(struct i2c_adapter *adap, int addr, ir->input->name, ir->input->phys, adap->name); /* start polling via eventd */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&ir->work, ir_work, ir); +#else + INIT_WORK(&ir->work, ir_work); +#endif init_timer(&ir->timer); ir->timer.function = ir_timer; ir->timer.data = (unsigned long)ir; diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index 1105e4257..62383f979 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -58,7 +58,11 @@ #include <media/msp3400.h> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #include <linux/kthread.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #include <linux/suspend.h> +#else +#include <linux/freezer.h> +#endif #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include "i2c-compat.h" diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-context.c b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c index f129f316d..19787dc81 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-context.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c @@ -45,16 +45,33 @@ static void pvr2_context_trigger_poll(struct pvr2_context *mp) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void pvr2_context_poll(struct pvr2_context *mp) +#else +static void pvr2_context_poll(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + struct pvr2_context *mp = + container_of(work, struct pvr2_context, workpoll); +#endif pvr2_context_enter(mp); do { pvr2_hdw_poll(mp->hdw); } while (0); pvr2_context_exit(mp); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void pvr2_context_setup(struct pvr2_context *mp) +#else +static void pvr2_context_setup(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + struct pvr2_context *mp = + container_of(work, struct pvr2_context, workinit); + +#endif pvr2_context_enter(mp); do { if (!pvr2_hdw_dev_ok(mp->hdw)) break; pvr2_hdw_setup(mp->hdw); @@ -92,8 +109,13 @@ struct pvr2_context *pvr2_context_create( } mp->workqueue = create_singlethread_workqueue("pvrusb2"); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&mp->workinit,(void (*)(void*))pvr2_context_setup,mp); INIT_WORK(&mp->workpoll,(void (*)(void*))pvr2_context_poll,mp); +#else + INIT_WORK(&mp->workinit, pvr2_context_setup); + INIT_WORK(&mp->workpoll, pvr2_context_poll); +#endif queue_work(mp->workqueue,&mp->workinit); done: return mp; diff --git a/linux/drivers/media/video/saa6588.c b/linux/drivers/media/video/saa6588.c index 4b2375c80..ff6f29eac 100644 --- a/linux/drivers/media/video/saa6588.c +++ b/linux/drivers/media/video/saa6588.c @@ -331,9 +331,17 @@ static void saa6588_timer(unsigned long data) schedule_work(&s->work); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void saa6588_work(void *data) +#else +static void saa6588_work(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct saa6588 *s = (struct saa6588 *)data; +#else + struct saa6588 *s = container_of(work, struct saa6588, work); +#endif saa6588_i2c_poll(s); mod_timer(&s->timer, jiffies + msecs_to_jiffies(20)); @@ -430,7 +438,11 @@ static int saa6588_attach(struct i2c_adapter *adap, int addr, unsigned short fla saa6588_configure(s); /* start polling via eventd */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&s->work, saa6588_work, s); +#else + INIT_WORK(&s->work, saa6588_work); +#endif init_timer(&s->timer); s->timer.function = saa6588_timer; s->timer.data = (unsigned long)s; diff --git a/linux/drivers/media/video/saa7134/saa7134-empress.c b/linux/drivers/media/video/saa7134/saa7134-empress.c index 690891588..8c12c2cc2 100644 --- a/linux/drivers/media/video/saa7134/saa7134-empress.c +++ b/linux/drivers/media/video/saa7134/saa7134-empress.c @@ -353,9 +353,18 @@ static struct video_device saa7134_empress_template = .minor = -1, }; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void empress_signal_update(void* data) +#else +static void empress_signal_update(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct saa7134_dev* dev = (struct saa7134_dev*) data; +#else + struct saa7134_dev* dev = + container_of(work, struct saa7134_dev, empress_workqueue); +#endif if (dev->nosignal) { dprintk("no video signal\n"); @@ -390,7 +399,11 @@ static int empress_init(struct saa7134_dev *dev) "%s empress (%s)", dev->name, saa7134_boards[dev->board].name); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&dev->empress_workqueue, empress_signal_update, (void*) dev); +#else + INIT_WORK(&dev->empress_workqueue, empress_signal_update); +#endif err = video_register_device(dev->empress_dev,VFL_TYPE_GRABBER, empress_nr[dev->nr]); @@ -411,7 +424,11 @@ static int empress_init(struct saa7134_dev *dev) sizeof(struct saa7134_buf), dev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) empress_signal_update(dev); +#else + empress_signal_update(&dev->empress_workqueue); +#endif return 0; } diff --git a/linux/drivers/media/video/tvaudio.c b/linux/drivers/media/video/tvaudio.c index a551af799..e08484fd2 100644 --- a/linux/drivers/media/video/tvaudio.c +++ b/linux/drivers/media/video/tvaudio.c @@ -30,6 +30,9 @@ #include <linux/init.h> #include <linux/smp_lock.h> #include <linux/kthread.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) +#include <linux/freezer.h> +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include "i2c-compat.h" diff --git a/linux/drivers/media/video/usbvision/usbvision-core.c b/linux/drivers/media/video/usbvision/usbvision-core.c index 071b11e75..2d20c809d 100644 --- a/linux/drivers/media/video/usbvision/usbvision-core.c +++ b/linux/drivers/media/video/usbvision/usbvision-core.c @@ -2286,14 +2286,23 @@ int usbvision_power_on(struct usb_usbvision *usbvision) */ // to call usbvision_power_off from task queue +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void call_usbvision_power_off(void *_usbvision) +#else +static void call_usbvision_power_off(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct usb_usbvision *usbvision = _usbvision; +#else + struct usb_usbvision *usbvision = container_of(work, struct usb_usbvision, powerOffWork); +#endif PDEBUG(DBG_FUNC, ""); down_interruptible(&usbvision->lock); if(usbvision->user == 0) { usbvision_i2c_usb_del_bus(&usbvision->i2c_adap); + usbvision_power_off(usbvision); usbvision->initialized = 0; } @@ -2310,7 +2319,11 @@ static void usbvision_powerOffTimer(unsigned long data) INIT_TQUEUE(&usbvision->powerOffTask, call_usbvision_power_off, usbvision); (void) schedule_task(&usbvision->powerOffTask); #else +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&usbvision->powerOffWork, call_usbvision_power_off, usbvision); +#else + INIT_WORK(&usbvision->powerOffWork, call_usbvision_power_off); +#endif (void) schedule_work(&usbvision->powerOffWork); #endif diff --git a/linux/drivers/media/video/video-buf-dvb.c b/linux/drivers/media/video/video-buf-dvb.c index b5e472c4d..86993f95a 100644 --- a/linux/drivers/media/video/video-buf-dvb.c +++ b/linux/drivers/media/video/video-buf-dvb.c @@ -22,7 +22,11 @@ #include <linux/fs.h> #include <linux/kthread.h> #include <linux/file.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #include <linux/suspend.h> +#else +#include <linux/freezer.h> +#endif #include <media/video-buf.h> #include <media/video-buf-dvb.h> diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c index 87e93b524..b0009fe0f 100644 --- a/linux/drivers/media/video/videodev.c +++ b/linux/drivers/media/video/videodev.c @@ -120,7 +120,11 @@ static DEFINE_MUTEX(videodev_lock); struct video_device* video_devdata(struct file *file) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) return video_device[iminor(file->f_dentry->d_inode)]; +#else + return video_device[iminor(file->f_path.dentry->d_inode)]; +#endif } /* diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c index 9b1407426..751128368 100644 --- a/linux/drivers/media/video/vivi.c +++ b/linux/drivers/media/video/vivi.c @@ -39,6 +39,9 @@ #include <linux/kthread.h> #endif #include <linux/highmem.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) +#include <linux/freezer.h> +#endif /* Wake up at about 30 fps */ #define WAKE_NUMERATOR 30 diff --git a/linux/drivers/media/video/zoran_procfs.c b/linux/drivers/media/video/zoran_procfs.c index c63752b54..77cbe49c3 100644 --- a/linux/drivers/media/video/zoran_procfs.c +++ b/linux/drivers/media/video/zoran_procfs.c @@ -145,7 +145,11 @@ static int zoran_open(struct inode *inode, struct file *file) static ssize_t zoran_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct zoran *zr = PDE(file->f_dentry->d_inode)->data; +#else + struct zoran *zr = PDE(file->f_path.dentry->d_inode)->data; +#endif char *string, *sp; char *line, *ldelim, *varname, *svar, *tdelim; @@ -166,7 +170,11 @@ static ssize_t zoran_write(struct file *file, const char __user *buffer, } string[count] = 0; dprintk(4, KERN_INFO "%s: write_proc: name=%s count=%zu zr=%p\n", +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ZR_DEVNAME(zr), file->f_dentry->d_name.name, count, zr); +#else + ZR_DEVNAME(zr), file->f_path.dentry->d_name.name, count, zr); +#endif ldelim = " \t\n"; tdelim = "="; line = strpbrk(sp, ldelim); |