[PATCH] fixes for compiling against kernel 2.6.14

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In kernel 2.6.14, method input_register_device returns void, whereas in the latest hg we're expecting int. Also, use of __GFP_DMA32 should be changed to __GFP_DMA for 2.6.14 and below. From what I understand, use of __GFP_DMA32 isn't necessary anyway. Please see attached patch.

- Mark.
diff -rup v4l-dvb-344763ebb94b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c v4l-dvb-344763ebb94b.new/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
--- v4l-dvb-344763ebb94b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c	2007-01-16 10:10:16.000000000 -0500
+++ v4l-dvb-344763ebb94b.new/linux/drivers/media/dvb/cinergyT2/cinergyT2.c	2007-01-16 10:49:24.000000000 -0500
@@ -841,7 +841,9 @@ static int cinergyt2_register_rc(struct 
 {
 	struct input_dev *input_dev;
 	int i;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	int err;
+#endif
 
 	input_dev = input_allocate_device();
 	if (!input_dev)
@@ -865,12 +867,15 @@ static int cinergyt2_register_rc(struct 
 	input_dev->keycodesize = 0;
 	input_dev->keycodemax = 0;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	err = input_register_device(input_dev);
 	if (err) {
 		input_free_device(input_dev);
 		return err;
 	}
-
+#else
+	input_register_device(input_dev);
+#endif
 	cinergyt2->rc_input_dev = input_dev;
 	schedule_delayed_work(&cinergyt2->rc_query_work, HZ/2);
 
diff -rup v4l-dvb-344763ebb94b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c v4l-dvb-344763ebb94b.new/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
--- v4l-dvb-344763ebb94b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c	2007-01-16 10:10:16.000000000 -0500
+++ v4l-dvb-344763ebb94b.new/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c	2007-01-16 10:29:13.000000000 -0500
@@ -106,7 +106,9 @@ int dvb_usb_remote_init(struct dvb_usb_d
 {
 	struct input_dev *input_dev;
 	int i;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	int err;
+#endif
 
 	if (d->props.rc_key_map == NULL ||
 		d->props.rc_query == NULL ||
@@ -146,11 +148,15 @@ int dvb_usb_remote_init(struct dvb_usb_d
 	input_dev->rep[REP_PERIOD] = d->props.rc_interval;
 	input_dev->rep[REP_DELAY]  = d->props.rc_interval + 150;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	err = input_register_device(input_dev);
 	if (err) {
 		input_free_device(input_dev);
 		return err;
 	}
+#else
+	input_register_device(input_dev);
+#endif
 
 	d->rc_input_dev = input_dev;
 
diff -rup v4l-dvb-344763ebb94b/linux/drivers/media/dvb/ttpci/av7110_ir.c v4l-dvb-344763ebb94b.new/linux/drivers/media/dvb/ttpci/av7110_ir.c
--- v4l-dvb-344763ebb94b/linux/drivers/media/dvb/ttpci/av7110_ir.c	2007-01-16 10:10:16.000000000 -0500
+++ v4l-dvb-344763ebb94b.new/linux/drivers/media/dvb/ttpci/av7110_ir.c	2007-01-16 10:27:34.000000000 -0500
@@ -215,7 +215,9 @@ static void ir_handler(struct av7110 *av
 int __devinit av7110_ir_init(struct av7110 *av7110)
 {
 	static struct proc_dir_entry *e;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	int err;
+#endif
 
 	if (av_cnt >= sizeof av_list/sizeof av_list[0])
 		return -ENOSPC;
@@ -236,11 +238,15 @@ int __devinit av7110_ir_init(struct av71
 		set_bit(EV_KEY, input_dev->evbit);
 		set_bit(EV_REP, input_dev->evbit);
 		input_register_keys();
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 		err = input_register_device(input_dev);
 		if (err) {
 			input_free_device(input_dev);
 			return err;
 		}
+#else
+		input_register_device(input_dev);
+#endif
 		input_dev->timer.function = input_repeat_key;
 
 		e = create_proc_entry("av7110_ir", S_IFREG | S_IRUGO | S_IWUSR, NULL);
diff -rup v4l-dvb-344763ebb94b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c v4l-dvb-344763ebb94b.new/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- v4l-dvb-344763ebb94b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c	2007-01-16 10:10:16.000000000 -0500
+++ v4l-dvb-344763ebb94b.new/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c	2007-01-16 10:48:14.000000000 -0500
@@ -1207,7 +1207,9 @@ static int ttusb_init_rc( struct ttusb_d
 	struct input_dev *input_dev;
 	u8 b[] = { 0x00, 0x01 };
 	int i;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	int err;
+#endif
 
 	usb_make_path(dec->udev, dec->rc_phys, sizeof(dec->rc_phys));
 	strlcpy(dec->rc_phys, "/input0", sizeof(dec->rc_phys));
@@ -1226,12 +1228,15 @@ static int ttusb_init_rc( struct ttusb_d
 	for (i = 0; i < ARRAY_SIZE(rc_keys); i++)
 		  set_bit(rc_keys[i], input_dev->keybit);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	err = input_register_device(input_dev);
 	if (err) {
 		input_free_device(input_dev);
 		return err;
 	}
-
+#else
+	input_register_device(input_dev);
+#endif
 	dec->rc_input_dev = input_dev;
 	if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
 		printk("%s: usb_submit_urb failed\n",__FUNCTION__);
diff -rup v4l-dvb-344763ebb94b/linux/drivers/media/video/bt8xx/bttv-input.c v4l-dvb-344763ebb94b.new/linux/drivers/media/video/bt8xx/bttv-input.c
--- v4l-dvb-344763ebb94b/linux/drivers/media/video/bt8xx/bttv-input.c	2007-01-16 10:10:16.000000000 -0500
+++ v4l-dvb-344763ebb94b.new/linux/drivers/media/video/bt8xx/bttv-input.c	2007-01-16 10:59:33.000000000 -0500
@@ -153,7 +153,13 @@ static int bttv_rc5_irq(struct bttv *btv
 static void bttv_ir_start(struct bttv *btv, struct card_ir *ir)
 {
 	if (ir->polling) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 		setup_timer(&ir->timer, bttv_input_timer, (unsigned long)btv);
+#else
+		ir->timer.function = bttv_input_timer;
+		ir->timer.data = (unsigned long)btv;
+		init_timer(&ir->timer);
+#endif
 		ir->timer.expires  = jiffies + HZ;
 		add_timer(&ir->timer);
 	} else if (ir->rc5_gpio) {
@@ -326,19 +332,24 @@ int bttv_input_init(struct bttv *btv)
 	bttv_ir_start(btv, ir);
 
 	/* all done */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	err = input_register_device(btv->remote->dev);
 	if (err)
 		goto err_out_stop;
+#else
+	input_register_device(btv->remote->dev);
+#endif
 
 	/* the remote isn't as bouncy as a keyboard */
 	ir->dev->rep[REP_DELAY] = repeat_delay;
 	ir->dev->rep[REP_PERIOD] = repeat_period;
 
 	return 0;
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
  err_out_stop:
 	bttv_ir_stop(btv);
 	btv->remote = NULL;
+#endif
  err_out_free:
 	input_free_device(input_dev);
 	kfree(ir);
diff -rup v4l-dvb-344763ebb94b/linux/drivers/media/video/cx88/cx88-input.c v4l-dvb-344763ebb94b.new/linux/drivers/media/video/cx88/cx88-input.c
--- v4l-dvb-344763ebb94b/linux/drivers/media/video/cx88/cx88-input.c	2007-01-16 10:10:16.000000000 -0500
+++ v4l-dvb-344763ebb94b.new/linux/drivers/media/video/cx88/cx88-input.c	2007-01-16 10:25:22.000000000 -0500
@@ -355,15 +355,20 @@ int cx88_ir_init(struct cx88_core *core,
 	cx88_ir_start(core, ir);
 
 	/* all done */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	err = input_register_device(ir->input);
 	if (err)
 		goto err_out_stop;
-
+#else
+	input_register_device(ir->input);
+#endif
 	return 0;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
  err_out_stop:
 	cx88_ir_stop(core, ir);
 	core->ir = NULL;
+#endif
  err_out_free:
 	input_free_device(input_dev);
 	kfree(ir);
diff -rup v4l-dvb-344763ebb94b/linux/drivers/media/video/ir-kbd-i2c.c v4l-dvb-344763ebb94b.new/linux/drivers/media/video/ir-kbd-i2c.c
--- v4l-dvb-344763ebb94b/linux/drivers/media/video/ir-kbd-i2c.c	2007-01-16 10:10:16.000000000 -0500
+++ v4l-dvb-344763ebb94b.new/linux/drivers/media/video/ir-kbd-i2c.c	2007-01-16 10:34:43.000000000 -0500
@@ -412,9 +412,13 @@ static int ir_attach(struct i2c_adapter 
 	input_dev->name       = ir->c.name;
 	input_dev->phys       = ir->phys;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	err = input_register_device(ir->input);
 	if (err)
 		goto err_out_detach;
+#else
+	input_register_device(ir->input);
+#endif
 
 	printk(DEVNAME ": %s detected at %s [%s]\n",
 	       ir->input->name, ir->input->phys, adap->name);
diff -rup v4l-dvb-344763ebb94b/linux/drivers/media/video/saa7134/saa7134-input.c v4l-dvb-344763ebb94b.new/linux/drivers/media/video/saa7134/saa7134-input.c
--- v4l-dvb-344763ebb94b/linux/drivers/media/video/saa7134/saa7134-input.c	2007-01-16 10:10:16.000000000 -0500
+++ v4l-dvb-344763ebb94b.new/linux/drivers/media/video/saa7134/saa7134-input.c	2007-01-16 10:31:38.000000000 -0500
@@ -386,15 +386,21 @@ int saa7134_input_init1(struct saa7134_d
 	dev->remote = ir;
 	saa7134_ir_start(dev, ir);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	err = input_register_device(ir->dev);
 	if (err)
 		goto err_out_stop;
+#else
+	input_register_device(ir->dev);
+#endif
 
 	return 0;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
  err_out_stop:
 	saa7134_ir_stop(dev);
 	dev->remote = NULL;
+#endif
  err_out_free:
 	input_free_device(input_dev);
 	kfree(ir);
diff -rup v4l-dvb-344763ebb94b/linux/drivers/media/video/video-buf.c v4l-dvb-344763ebb94b.new/linux/drivers/media/video/video-buf.c
--- v4l-dvb-344763ebb94b/linux/drivers/media/video/video-buf.c	2007-01-16 10:10:16.000000000 -0500
+++ v4l-dvb-344763ebb94b.new/linux/drivers/media/video/video-buf.c	2007-01-16 10:44:25.000000000 -0500
@@ -1240,7 +1240,11 @@ videobuf_vm_nopage(struct vm_area_struct
 		vaddr,vma->vm_start,vma->vm_end);
 	if (vaddr > vma->vm_end)
 		return NOPAGE_SIGBUS;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
 	page = alloc_page(GFP_USER | __GFP_DMA32);
+#else
+	page = alloc_page(GFP_USER | __GFP_DMA);
+#endif
 	if (!page)
 		return NOPAGE_OOM;
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,20)
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux