Commit 82b7e321 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] dvb: Cleanup patch to remove 2.4 crud

From: Michael Hunold <hunold@linuxtv.org>

remove various LINUX_VERSION_CODE code paths

fix compile bug in new bt8xx/Makefile
parent 016b74ef
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
......@@ -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"
......
......@@ -179,40 +179,6 @@ static int __init dvb_bt8xx_card_match(unsigned int bttv_nr, char *card_name, u3
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(void)
{
i2c_del_driver(&dvb_bt8xx_driver);
}
#endif
static int __init dvb_bt8xx_load_card( struct dvb_bt8xx_card *card)
{
......
/*
* 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);
......@@ -35,12 +35,6 @@
#include <linux/interrupt.h>
#include <linux/input.h>
#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;
......
......@@ -742,11 +742,7 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len)
}
}
#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 *urb, struct pt_regs *ptregs)
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 ttusb *ttusb)
}
}
#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_interface *intf, const struct usb_device_id *i
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_interface *intf, const struct usb_device_id *i
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
......
#include <linux/module.h>
#include <linux/vermagic.h>
#include <linux/compiler.h>
MODULE_INFO(vermagic, VERMAGIC_STRING);
static const struct modversion_info ____versions[]
__attribute__((section("__versions"))) = {
{ 0x98a034c6, "struct_module" },
{ 0x1b636da2, "usb_deregister" },
{ 0x9c655b4f, "usb_register" },
{ 0x37a0cba, "kfree" },
{ 0xc490b263, "dvb_unregister_adapter" },
{ 0xf0ca7c9b, "dvb_unregister_i2c_bus" },
{ 0x213a4973, "dvb_dmxdev_release" },
{ 0x12014018, "dvb_net_release" },
{ 0x616af636, "dvb_net_init" },
{ 0x6a8b7cf7, "dvb_dmx_release" },
{ 0x107a341d, "dvb_dmxdev_init" },
{ 0x8fa22872, "dvb_dmx_init" },
{ 0x5117ed38, "dvb_add_frontend_ioctls" },
{ 0xfc17c7e7, "dvb_register_i2c_bus" },
{ 0x3ad6f025, "dvb_register_adapter" },
{ 0x7ac96080, "kmem_cache_alloc" },
{ 0xa73704a, "malloc_sizes" },
{ 0xdfcbe89f, "usb_set_interface" },
{ 0x4f0eac15, "usb_reset_configuration" },
{ 0x1b49153f, "usb_unlink_urb" },
{ 0xf136026d, "usb_alloc_urb" },
{ 0xe6f8a15d, "dma_alloc_coherent" },
{ 0xe8d874ea, "dma_free_coherent" },
{ 0x8ee31378, "usb_free_urb" },
{ 0x53e02b2e, "usb_submit_urb" },
{ 0xda02d67, "jiffies" },
{ 0x4f7c0ba8, "dvb_dmx_swfilter_packets" },
{ 0x9d669763, "memcpy" },
{ 0xd22b546, "__up_wakeup" },
{ 0x1b7d4074, "printk" },
{ 0x85eee601, "usb_bulk_msg" },
{ 0x28c3bbf5, "__down_failed_interruptible" },
{ 0xd533bec7, "__might_sleep" },
};
static const char __module_depends[]
__attribute_used__
__attribute__((section(".modinfo"))) =
"depends=usbcore,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*");
......@@ -28,9 +28,7 @@
#include <linux/usb.h>
#include <linux/version.h>
#include <linux/interrupt.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#include <linux/firmware.h>
#endif
#include "dmxdev.h"
#include "dvb_demux.h"
......@@ -473,11 +471,7 @@ static void ttusb_dec_process_urb_frame_list(unsigned long data)
}
}
#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 urb *urb, struct pt_regs *ptregs)
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 *urb, struct pt_regs *ptregs)
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 ttusb_dec *dec)
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(struct ttusb_dec *dec)
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(struct ttusb_dec *dec)
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(struct ttusb_dec *dec)
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(struct ttusb_dec *dec)
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 ttusb_dec *dec)
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 ttusb_dec *dec)
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 ttusb_dec *dec)
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(struct ttusb_dec *dec)
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_interface *intf,
}
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_interface *intf,
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__);
......
#include <linux/module.h>
#include <linux/vermagic.h>
#include <linux/compiler.h>
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*");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment