From: Michael Hunold remove various LINUX_VERSION_CODE code paths fix compile bug in new bt8xx/Makefile 25-akpm/drivers/media/dvb/bt8xx/Makefile | 2 25-akpm/drivers/media/dvb/bt8xx/bt878.c | 4 25-akpm/drivers/media/dvb/bt8xx/dvb-bt8xx.c | 35 ---- 25-akpm/drivers/media/dvb/frontends/dst-bt878.h | 8 25-akpm/drivers/media/dvb/ttpci/budget-ci.c | 6 25-akpm/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 46 ----- 25-akpm/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.mod.c | 14 + 25-akpm/drivers/media/dvb/ttusb-dec/ttusb_dec.c | 82 ---------- 25-akpm/drivers/media/dvb/ttusb-dec/ttusb_dec.mod.c | 13 + 9 files changed, 38 insertions(+), 172 deletions(-) diff -puN drivers/media/dvb/bt8xx/bt878.c~dvb-10-cleanup drivers/media/dvb/bt8xx/bt878.c --- 25/drivers/media/dvb/bt8xx/bt878.c~dvb-10-cleanup Fri Dec 19 14:55:10 2003 +++ 25-akpm/drivers/media/dvb/bt8xx/bt878.c Fri Dec 19 14:55:10 2003 @@ -44,11 +44,7 @@ #include "dmxdev.h" #include "dvbdev.h" #include "bt878.h" -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) #include "dst-bt878.h" -#else -#include "../frontends/dst-bt878.h" -#endif #include "dvb_functions.h" diff -puN drivers/media/dvb/bt8xx/dvb-bt8xx.c~dvb-10-cleanup drivers/media/dvb/bt8xx/dvb-bt8xx.c --- 25/drivers/media/dvb/bt8xx/dvb-bt8xx.c~dvb-10-cleanup Fri Dec 19 14:55:10 2003 +++ 25-akpm/drivers/media/dvb/bt8xx/dvb-bt8xx.c Fri Dec 19 14:55:10 2003 @@ -179,40 +179,6 @@ static int __init dvb_bt8xx_card_match(u return 0; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) -/* with 2.6.x not needed thanks to the driver model + sysfs */ - -extern struct i2c_adapter *bttv_get_i2c_adap(unsigned int card); - -static void __init dvb_bt8xx_get_adaps(void) -{ - struct dvb_bt8xx_card *card; - struct list_head *entry, *entry_safe; - - list_for_each_safe(entry, entry_safe, &card_list) { - card = list_entry(entry, struct dvb_bt8xx_card, list); - card->i2c_adapter = bttv_get_i2c_adap(card->bttv_nr); - if (!card->i2c_adapter) { - printk("dvb_bt8xx: unable to determine i2c adaptor of card %d, deleting\n", card->bttv_nr); - - list_del(&card->list); - kfree(card); - } - } -} - -static void dvb_bt8xx_i2c_adap_free(struct i2c_adapter *adap) -{ -} - -static void __exit dvb_bt8xx_exit_adaps(void) -{ -} - -#else - -/* More complicated. but cleaner better */ - static struct dvb_bt8xx_card *dvb_bt8xx_find_by_i2c_adap(struct i2c_adapter *adap) { struct dvb_bt8xx_card *card; @@ -308,7 +274,6 @@ static void __exit dvb_bt8xx_exit_adaps( { i2c_del_driver(&dvb_bt8xx_driver); } -#endif static int __init dvb_bt8xx_load_card( struct dvb_bt8xx_card *card) { diff -puN drivers/media/dvb/bt8xx/Makefile~dvb-10-cleanup drivers/media/dvb/bt8xx/Makefile --- 25/drivers/media/dvb/bt8xx/Makefile~dvb-10-cleanup Fri Dec 19 14:55:10 2003 +++ 25-akpm/drivers/media/dvb/bt8xx/Makefile Fri Dec 19 14:55:10 2003 @@ -1,5 +1,5 @@ obj-$(CONFIG_DVB_BT8XX) += bt878.o dvb-bt8xx.o -EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/video +EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/video -Idrivers/media/dvb/frontends diff -puN drivers/media/dvb/frontends/dst-bt878.h~dvb-10-cleanup drivers/media/dvb/frontends/dst-bt878.h --- 25/drivers/media/dvb/frontends/dst-bt878.h~dvb-10-cleanup Fri Dec 19 14:55:10 2003 +++ 25-akpm/drivers/media/dvb/frontends/dst-bt878.h Fri Dec 19 14:55:10 2003 @@ -1,3 +1,8 @@ +/* + * dst-bt878.h: part of the DST driver for the TwinHan DST Frontend + * + * Copyright (C) 2003 Jamie Honan + */ struct dst_gpio_enable { u32 mask; @@ -27,7 +32,6 @@ union dst_gpio_packet { struct bt878 ; -int -bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet *mp); +int bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet *mp); struct bt878 *bt878_find_by_dvb_adap(struct dvb_adapter *adap); diff -puN drivers/media/dvb/ttpci/budget-ci.c~dvb-10-cleanup drivers/media/dvb/ttpci/budget-ci.c --- 25/drivers/media/dvb/ttpci/budget-ci.c~dvb-10-cleanup Fri Dec 19 14:55:10 2003 +++ 25-akpm/drivers/media/dvb/ttpci/budget-ci.c Fri Dec 19 14:55:10 2003 @@ -35,12 +35,6 @@ #include #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) -#include "input_fake.h" -#endif - - - struct budget_ci { struct budget budget; struct input_dev input_dev; diff -puN drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c~dvb-10-cleanup drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c --- 25/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c~dvb-10-cleanup Fri Dec 19 14:55:10 2003 +++ 25-akpm/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Fri Dec 19 14:55:10 2003 @@ -742,11 +742,7 @@ static void ttusb_process_frame(struct t } } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -static void ttusb_iso_irq(struct urb *urb) -#else static void ttusb_iso_irq(struct urb *urb, struct pt_regs *ptregs) -#endif { struct ttusb *ttusb = urb->context; @@ -787,9 +783,7 @@ static void ttusb_iso_irq(struct urb *ur ttusb_process_frame(ttusb, data, len); } } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) usb_submit_urb(urb, GFP_ATOMIC); -#endif } static void ttusb_free_iso_urbs(struct ttusb *ttusb) @@ -879,13 +873,6 @@ static int ttusb_start_iso_xfer(struct t } } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - for (i = 0; i < ISO_BUF_COUNT; i++) { - int next = (i + 1) % ISO_BUF_COUNT; - ttusb->iso_urb[i]->next = ttusb->iso_urb[next]; - } -#endif - for (i = 0; i < ISO_BUF_COUNT; i++) { if ((err = usb_submit_urb(ttusb->iso_urb[i], GFP_KERNEL))) { ttusb_stop_iso_xfer(ttusb); @@ -1076,22 +1063,6 @@ static struct file_operations stc_fops = }; #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -static void *ttusb_probe(struct usb_device *udev, unsigned int ifnum, - const struct usb_device_id *id) -{ - struct ttusb *ttusb; - int result, channel; - - if (ifnum != 0) - return NULL; - - dprintk("%s: TTUSB DVB connected\n", __FUNCTION__); - - if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL))) - return NULL; - -#else static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_device *udev; @@ -1105,8 +1076,6 @@ static int ttusb_probe(struct usb_interf if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL))) return -ENOMEM; -#endif - memset(ttusb, 0, sizeof(struct ttusb)); for (channel = 0; channel < TTUSB_MAXCHANNEL; ++channel) { @@ -1180,35 +1149,22 @@ static int ttusb_probe(struct usb_interf S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, &stc_fops, ttusb); #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - return (void *) ttusb; -#else + usb_set_intfdata(intf, (void *) ttusb); return 0; -#endif } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -static void ttusb_disconnect(struct usb_device *udev, void *data) -{ - struct ttusb *ttusb = data; -#else static void ttusb_disconnect(struct usb_interface *intf) { struct ttusb *ttusb = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); -#endif ttusb->disconnecting = 1; ttusb_stop_iso_xfer(ttusb); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)) -#undef devfs_remove -#define devfs_remove(x) devfs_unregister(ttusb->stc_devfs_handle); -#endif #if 0 devfs_remove(TTUSB_BUDGET_NAME); #endif diff -puN /dev/null drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.mod.c --- /dev/null Thu Apr 11 07:25:15 2002 +++ 25-akpm/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.mod.c Fri Dec 19 14:55:10 2003 @@ -0,0 +1,14 @@ +#include +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +static const char __module_depends[] +__attribute_used__ +__attribute__((section(".modinfo"))) = +"depends=dvb-core"; + +MODULE_ALIAS("usb:v0B48p1003dl*dh*dc*dsc*dp*ic*isc*ip*"); +MODULE_ALIAS("usb:v0B48p1004dl*dh*dc*dsc*dp*ic*isc*ip*"); +MODULE_ALIAS("usb:v0B48p1005dl*dh*dc*dsc*dp*ic*isc*ip*"); diff -puN drivers/media/dvb/ttusb-dec/ttusb_dec.c~dvb-10-cleanup drivers/media/dvb/ttusb-dec/ttusb_dec.c --- 25/drivers/media/dvb/ttusb-dec/ttusb_dec.c~dvb-10-cleanup Fri Dec 19 14:55:10 2003 +++ 25-akpm/drivers/media/dvb/ttusb-dec/ttusb_dec.c Fri Dec 19 14:55:10 2003 @@ -28,9 +28,7 @@ #include #include #include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #include -#endif #include "dmxdev.h" #include "dvb_demux.h" @@ -473,11 +471,7 @@ static void ttusb_dec_process_urb_frame_ } } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -static void ttusb_dec_process_urb(struct urb *urb) -#else static void ttusb_dec_process_urb(struct urb *urb, struct pt_regs *ptregs) -#endif { struct ttusb_dec *dec = urb->context; @@ -485,11 +479,8 @@ static void ttusb_dec_process_urb(struct int i; for (i = 0; i < FRAMES_PER_ISO_BUF; i++) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - struct iso_packet_descriptor *d; -#else struct usb_iso_packet_descriptor *d; -#endif + u8 *b; int length; struct urb_frame *frame; @@ -522,10 +513,8 @@ static void ttusb_dec_process_urb(struct urb->status); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) if (dec->iso_stream_count) usb_submit_urb(urb, GFP_ATOMIC); -#endif } static void ttusb_dec_setup_urbs(struct ttusb_dec *dec) @@ -542,12 +531,9 @@ static void ttusb_dec_setup_urbs(struct urb->context = dec; urb->complete = ttusb_dec_process_urb; urb->pipe = dec->stream_pipe; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) urb->transfer_flags = URB_ISO_ASAP; urb->interval = 1; -#else - urb->transfer_flags = USB_ISO_ASAP; -#endif + urb->number_of_packets = FRAMES_PER_ISO_BUF; urb->transfer_buffer_length = ISO_FRAME_SIZE * FRAMES_PER_ISO_BUF; @@ -614,12 +600,8 @@ static int ttusb_dec_start_iso_xfer(stru ttusb_dec_setup_urbs(dec); for (i = 0; i < ISO_BUF_COUNT; i++) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) if ((result = usb_submit_urb(dec->iso_urb[i], GFP_ATOMIC))) { -#else - if ((result = usb_submit_urb(dec->iso_urb[i]))) { -#endif printk("%s: failed urb submission %d: " "error %d\n", __FUNCTION__, i, result); @@ -641,10 +623,6 @@ static int ttusb_dec_start_iso_xfer(stru up(&dec->iso_sem); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - ttusb_dec_set_streaming_interface(dec); -#endif - return 0; } @@ -775,11 +753,7 @@ static int ttusb_dec_alloc_iso_urbs(stru for (i = 0; i < ISO_BUF_COUNT; i++) { struct urb *urb; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) if (!(urb = usb_alloc_urb(FRAMES_PER_ISO_BUF, GFP_ATOMIC))) { -#else - if (!(urb = usb_alloc_urb(FRAMES_PER_ISO_BUF))) { -#endif ttusb_dec_free_iso_urbs(dec); return -ENOMEM; } @@ -789,13 +763,6 @@ static int ttusb_dec_alloc_iso_urbs(stru ttusb_dec_setup_urbs(dec); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - for (i = 0; i < ISO_BUF_COUNT; i++) { - int next = (i + 1) % ISO_BUF_COUNT; - dec->iso_urb[i]->next = dec->iso_urb[next]; - } -#endif - return 0; } @@ -831,11 +798,6 @@ static void ttusb_dec_init_usb(struct tt ttusb_dec_alloc_iso_urbs(dec); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#include "dsp_dec2000t.h" -#include "dsp_dec3000s.h" -#endif - static int ttusb_dec_boot_dsp(struct ttusb_dec *dec) { int i, j, actual_len, result, size, trans_count; @@ -848,13 +810,10 @@ static int ttusb_dec_boot_dsp(struct ttu u32 firmware_csum = 0; u32 firmware_size_nl; u32 firmware_csum_nl; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) const struct firmware *fw_entry = NULL; -#endif dprintk("%s\n", __FUNCTION__); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) if (request_firmware(&fw_entry, dec->firmware_name, &dec->udev->dev)) { printk(KERN_ERR "%s: Firmware (%s) unavailable.\n", __FUNCTION__, dec->firmware_name); @@ -863,21 +822,13 @@ static int ttusb_dec_boot_dsp(struct ttu firmware = fw_entry->data; firmware_size = fw_entry->size; -#endif + switch (dec->model) { case TTUSB_DEC2000T: -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - firmware = &dsp_dec2000t[0]; - firmware_size = sizeof(dsp_dec2000t); -#endif firmware_csum = 0x1bc86100; break; case TTUSB_DEC3000S: -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - firmware = &dsp_dec3000s[0]; - firmware_size = sizeof(dsp_dec3000s); -#endif firmware_csum = 0x00000000; break; } @@ -1313,22 +1264,6 @@ static void ttusb_dec_exit_frontend(stru dvb_unregister_frontend(dec->frontend_ioctl, &dec->i2c_bus); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -static void *ttusb_dec_probe(struct usb_device *udev, unsigned int ifnum, - const struct usb_device_id *id) -{ - struct ttusb_dec *dec; - - dprintk("%s\n", __FUNCTION__); - - if (ifnum != 0) - return NULL; - - if (!(dec = kmalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) { - printk("%s: couldn't allocate memory.\n", __FUNCTION__); - return NULL; - } -#else static int ttusb_dec_probe(struct usb_interface *intf, const struct usb_device_id *id) { @@ -1345,7 +1280,6 @@ static int ttusb_dec_probe(struct usb_in } usb_set_intfdata(intf, (void *)dec); -#endif memset(dec, 0, sizeof(struct ttusb_dec)); @@ -1377,26 +1311,16 @@ static int ttusb_dec_probe(struct usb_in dec->active = 1; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - return (void *)dec; -#else ttusb_dec_set_streaming_interface(dec); return 0; -#endif } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -static void ttusb_dec_disconnect(struct usb_device *udev, void *data) -{ - struct ttusb_dec *dec = data; -#else static void ttusb_dec_disconnect(struct usb_interface *intf) { struct ttusb_dec *dec = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); -#endif dprintk("%s\n", __FUNCTION__); diff -puN /dev/null drivers/media/dvb/ttusb-dec/ttusb_dec.mod.c --- /dev/null Thu Apr 11 07:25:15 2002 +++ 25-akpm/drivers/media/dvb/ttusb-dec/ttusb_dec.mod.c Fri Dec 19 14:55:10 2003 @@ -0,0 +1,13 @@ +#include +#include +#include + +MODULE_INFO(vermagic, VERMAGIC_STRING); + +static const char __module_depends[] +__attribute_used__ +__attribute__((section(".modinfo"))) = +"depends=dvb-core"; + +MODULE_ALIAS("usb:v0B48p1006dl*dh*dc*dsc*dp*ic*isc*ip*"); +MODULE_ALIAS("usb:v0B48p1008dl*dh*dc*dsc*dp*ic*isc*ip*"); _