From 5e8fe57d32dd88f0f84ff9c19e57d2e586dba9a7 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Tue, 22 Apr 2003 16:30:45 +0000 Subject: =?UTF-8?q?-=20removed=20the=20compatibility=20crap=20around=20KBU?= =?UTF-8?q?ILD=5FMODNAME=20from=20all=20drivers,=20=20=20use=20=20KBUILD?= =?UTF-8?q?=5FBASENAME=20for=202.4=20instead=20=C2=AD=20some=20changes=20t?= =?UTF-8?q?o=20the=20i2c=20core=20to=20make=20it=20work=20with=20both=202.?= =?UTF-8?q?4=20and=20late=202.5=20=20=20kernels=20(not=20done=20yet=20--?= =?UTF-8?q?=20only=20interesting=20for=20analog=20drivers)=20-=20add=20MOD?= =?UTF-8?q?ULE=5FDEVICE=5FTABLE=20to=20all=20drivers,=20so=20that=20pci=20?= =?UTF-8?q?"hotplug"=20can=20detect=20=20=20the=20devices=20automatically.?= =?UTF-8?q?=20Alan=20Cox=20says,=20that=20we=20should=20use=20this=20to=20?= =?UTF-8?q?load=20=20=20the=20firmware=20(not=20done=20yet)=20-=20fix=20th?= =?UTF-8?q?e=20long=20standing=20"insmod/rmmod=20with=20multiple=20budget?= =?UTF-8?q?=20cards"=20bug=20--=20it=20=20=20was=20a=20double=20kfree()=20?= =?UTF-8?q?call...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux/drivers/media/common/saa7146_core.c | 4 ---- linux/drivers/media/common/saa7146_fops.c | 4 ---- linux/drivers/media/common/saa7146_hlp.c | 4 ---- linux/drivers/media/common/saa7146_i2c.c | 15 +++++++++------ linux/drivers/media/common/saa7146_vbi.c | 4 ---- linux/drivers/media/common/saa7146_video.c | 4 ---- 6 files changed, 9 insertions(+), 26 deletions(-) (limited to 'linux/drivers/media/common') diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c index 385757bab..cad3931a4 100644 --- a/linux/drivers/media/common/saa7146_core.c +++ b/linux/drivers/media/common/saa7146_core.c @@ -20,10 +20,6 @@ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - #define KBUILD_MODNAME saa7146 -#endif - /* global variables */ struct list_head saa7146_devices; struct semaphore saa7146_devices_lock; diff --git a/linux/drivers/media/common/saa7146_fops.c b/linux/drivers/media/common/saa7146_fops.c index 31a277fb4..1bda284e4 100644 --- a/linux/drivers/media/common/saa7146_fops.c +++ b/linux/drivers/media/common/saa7146_fops.c @@ -1,9 +1,5 @@ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - #define KBUILD_MODNAME saa7146 -#endif - #define BOARD_CAN_DO_VBI(dev) (dev->revision != 0 && dev->vv_data->vbi_minor != -1) /********************************************************************************/ diff --git a/linux/drivers/media/common/saa7146_hlp.c b/linux/drivers/media/common/saa7146_hlp.c index a5f374915..cc7180954 100644 --- a/linux/drivers/media/common/saa7146_hlp.c +++ b/linux/drivers/media/common/saa7146_hlp.c @@ -1,9 +1,5 @@ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - #define KBUILD_MODNAME saa7146 -#endif - #define my_min(type,x,y) \ ({ type __x = (x), __y = (y); __x < __y ? __x: __y; }) #define my_max(type,x,y) \ diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index 33f750799..a1dedcae8 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -1,9 +1,5 @@ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - #define KBUILD_MODNAME saa7146 -#endif - /* helper function */ static void my_wait(struct saa7146_dev *dev, long ms) @@ -380,9 +376,11 @@ out: static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num) { - struct saa7146_dev* dev = (struct saa7146_dev*)adapter->data; - + struct saa7146_dev* dev = i2c_get_adapdata(adapter); + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) DEB_I2C(("adapter: '%s'.\n", adapter->name)); +#endif /* use helper function to transfer data */ return saa7146_i2c_transfer(dev, msg, num, adapter->retries); @@ -412,8 +410,13 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c if( NULL != i2c_adapter ) { memset(i2c_adapter,0,sizeof(struct i2c_adapter)); strcpy(i2c_adapter->name, dev->name); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) i2c_adapter->data = dev; i2c_adapter->algo = &saa7146_algo; +#else + strcpy(i2c_adapter->dev.name, dev->name); + i2c_set_adapdata(i2c_adapter,dev); +#endif i2c_adapter->algo_data = NULL; i2c_adapter->id = I2C_ALGO_SAA7146; i2c_adapter->timeout = SAA7146_I2C_TIMEOUT; diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c index 2b273e4d1..4e3eacb30 100644 --- a/linux/drivers/media/common/saa7146_vbi.c +++ b/linux/drivers/media/common/saa7146_vbi.c @@ -1,9 +1,5 @@ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - #define KBUILD_MODNAME saa7146 -#endif - static int vbi_pixel_to_capture = 720 * 2; static diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index eb090eeeb..7cacfcbdd 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -1,9 +1,5 @@ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - #define KBUILD_MODNAME saa7146 -#endif - static int memory = 32; -- cgit v1.2.3