diff -ru rivatv-0.8.3-orig/bttv/tuner.c rivatv-0.8.3-i2c/bttv/tuner.c --- rivatv-0.8.3-orig/bttv/tuner.c 2003-07-04 20:25:13.000000000 +0200 +++ rivatv-0.8.3-i2c/bttv/tuner.c 2003-07-16 19:13:13.000000000 +0200 @@ -971,7 +971,7 @@ /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 9) .owner = THIS_MODULE, #endif .name = "i2c TV tuner driver", diff -ru rivatv-0.8.3-orig/bttv/tvaudio.c rivatv-0.8.3-i2c/bttv/tvaudio.c --- rivatv-0.8.3-orig/bttv/tvaudio.c 2003-07-04 20:25:13.000000000 +0200 +++ rivatv-0.8.3-i2c/bttv/tvaudio.c 2003-07-16 19:13:21.000000000 +0200 @@ -1648,7 +1648,7 @@ static struct i2c_driver driver = { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 9) .owner = THIS_MODULE, #endif .name = "generic i2c audio driver", diff -ru rivatv-0.8.3-orig/bttv/tvmixer.c rivatv-0.8.3-i2c/bttv/tvmixer.c --- rivatv-0.8.3-orig/bttv/tvmixer.c 2003-07-04 20:25:13.000000000 +0200 +++ rivatv-0.8.3-i2c/bttv/tvmixer.c 2003-07-16 19:13:02.000000000 +0200 @@ -197,8 +197,10 @@ /* lock bttv in memory while the mixer is in use */ file->private_data = mix; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) if (client->adapter->inc_use) client->adapter->inc_use(client->adapter); +#endif #else if (client->adapter->owner) try_module_get(client->adapter->owner); @@ -217,8 +219,10 @@ } #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) if (client->adapter->dec_use) client->adapter->dec_use(client->adapter); +#endif #else if (client->adapter->owner) module_put(client->adapter->owner); @@ -227,7 +231,7 @@ } static struct i2c_driver driver = { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 9) .owner = THIS_MODULE, #endif .name = "tv card mixer driver", diff -ru rivatv-0.8.3-orig/src/i2c-riva.c rivatv-0.8.3-i2c/src/i2c-riva.c --- rivatv-0.8.3-orig/src/i2c-riva.c 2003-07-04 20:25:13.000000000 +0200 +++ rivatv-0.8.3-i2c/src/i2c-riva.c 2003-07-16 18:21:20.000000000 +0200 @@ -237,8 +237,8 @@ .id = I2C_HW_B_RIVA, .client_register = bit_riva_reg, .client_unregister = bit_riva_unreg, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) .name = "NVIDIA display adapter bus 0", +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) .inc_use = i2c_adapter_inc_use, .dec_use = i2c_adapter_dec_use, #else @@ -250,8 +250,8 @@ .id = I2C_HW_B_RIVA, .client_register = bit_riva_reg, .client_unregister = bit_riva_unreg, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) .name = "NVIDIA display adapter bus 1", +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) .inc_use = i2c_adapter_inc_use, .dec_use = i2c_adapter_dec_use, #else @@ -263,8 +263,8 @@ .id = I2C_HW_B_RIVA, .client_register = bit_riva_reg, .client_unregister = bit_riva_unreg, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) .name = "NVIDIA display adapter bus 2", +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) .inc_use = i2c_adapter_inc_use, .dec_use = i2c_adapter_dec_use, #else diff -ru rivatv-0.8.3-orig/src/rivatv-kcompat.h rivatv-0.8.3-i2c/src/rivatv-kcompat.h --- rivatv-0.8.3-orig/src/rivatv-kcompat.h 2003-07-04 20:25:13.000000000 +0200 +++ rivatv-0.8.3-i2c/src/rivatv-kcompat.h 2003-07-16 19:11:04.000000000 +0200 @@ -61,7 +61,7 @@ } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) static inline void i2c_adapter_inc_use (struct i2c_adapter *adap) { @@ -83,6 +83,10 @@ MOD_DEC_USE_COUNT; } +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) + static inline void *i2c_get_adapdata (struct i2c_adapter *adap) { return adap->data; @@ -112,8 +116,10 @@ static inline int kcompat_i2c_client_get (struct i2c_client *client) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) i2c_inc_use_client (client); +#endif return 1; #else return try_module_get (client->driver->owner); @@ -122,8 +128,10 @@ static inline void kcompat_i2c_client_put (struct i2c_client *client) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) i2c_dec_use_client (client); +#endif #else module_put (client->driver->owner); #endif diff -ru rivatv-0.8.3-orig/src/saa7108e.c rivatv-0.8.3-i2c/src/saa7108e.c --- rivatv-0.8.3-orig/src/saa7108e.c 2003-07-04 20:25:13.000000000 +0200 +++ rivatv-0.8.3-i2c/src/saa7108e.c 2003-07-16 18:35:05.000000000 +0200 @@ -160,7 +160,7 @@ .attach_adapter = saa7108e_attach, .detach_client = saa7108e_detach, .command = saa7108e_command, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) .inc_use = i2c_client_inc_use, .dec_use = i2c_client_dec_use, #else @@ -170,9 +170,7 @@ /* Template for new clients */ static struct i2c_client saa7108e_client = { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) .name = "SAA7108E", -#endif .id = -1, .flags = 0, .addr = 0, diff -ru rivatv-0.8.3-orig/src/saa7111a.c rivatv-0.8.3-i2c/src/saa7111a.c --- rivatv-0.8.3-orig/src/saa7111a.c 2003-07-04 20:25:13.000000000 +0200 +++ rivatv-0.8.3-i2c/src/saa7111a.c 2003-07-16 18:35:36.000000000 +0200 @@ -129,7 +129,7 @@ .attach_adapter = saa7111a_attach, .detach_client = saa7111a_detach, .command = saa7111a_command, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) .inc_use = i2c_client_inc_use, .dec_use = i2c_client_dec_use, #else @@ -139,9 +139,7 @@ /* Template for new clients */ static struct i2c_client saa7111a_client = { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) .name = "SAA7111A", -#endif .id = -1, .flags = 0, .addr = 0, diff -ru rivatv-0.8.3-orig/src/saa7113h.c rivatv-0.8.3-i2c/src/saa7113h.c --- rivatv-0.8.3-orig/src/saa7113h.c 2003-07-04 20:25:13.000000000 +0200 +++ rivatv-0.8.3-i2c/src/saa7113h.c 2003-07-16 18:35:52.000000000 +0200 @@ -477,7 +477,7 @@ .attach_adapter = saa7113h_attach, .detach_client = saa7113h_detach, .command = saa7113h_command, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) .inc_use = i2c_client_inc_use, .dec_use = i2c_client_dec_use, #else @@ -487,9 +487,7 @@ /* Template for new clients */ static struct i2c_client saa7113h_client = { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) .name = "SAA7113H", -#endif .id = -1, .flags = 0, .addr = 0, diff -ru rivatv-0.8.3-orig/src/tw98.c rivatv-0.8.3-i2c/src/tw98.c --- rivatv-0.8.3-orig/src/tw98.c 2003-07-04 20:25:13.000000000 +0200 +++ rivatv-0.8.3-i2c/src/tw98.c 2003-07-16 18:36:33.000000000 +0200 @@ -86,7 +86,7 @@ .attach_adapter = tw98_attach, .detach_client = tw98_detach, .command = tw98_command, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) .inc_use = i2c_client_inc_use, .dec_use = i2c_client_dec_use, #else @@ -95,9 +95,7 @@ }; static struct i2c_client tw98_client = { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) .name = "TW98", -#endif .id = -1, .flags = 0, .addr = 0, diff -ru rivatv-0.8.3-orig/src/vpx32xx.c rivatv-0.8.3-i2c/src/vpx32xx.c --- rivatv-0.8.3-orig/src/vpx32xx.c 2003-07-04 20:25:13.000000000 +0200 +++ rivatv-0.8.3-i2c/src/vpx32xx.c 2003-07-16 18:37:29.000000000 +0200 @@ -113,7 +113,7 @@ .attach_adapter = vpx32xx_attach, .detach_client = vpx32xx_detach, .command = vpx32xx_command, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) .inc_use = i2c_client_inc_use, .dec_use = i2c_client_dec_use #else @@ -122,9 +122,7 @@ }; static struct i2c_client vpx32xx_client = { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) .name = "vpx32xx", -#endif .id = -1, .flags = 0, .addr = 0,