This time in the form of a now missing struct member. While I may not
agree with the kernel hackers new found love of screwing with things in
the middle of a stable kernel series, I don't make the rules, so I guess
we just have to live with it.
Attached is a patch that fixes compilation for ivtv-0.3.2h when using a
slightly-post-2.6.11 kernel. It's a quick hack that may not be suitable
for older kernels. I'm not exactly sure about that situation, but this
will at least get people working while we find a better solution (if
there is one).
diff -ruN ivtv-0.3.2h.orig/driver/compat.h ivtv-0.3.2h/driver/compat.h
--- ivtv-0.3.2h.orig/driver/compat.h 2004-12-05 18:26:56.000000000 -0600
+++ ivtv-0.3.2h/driver/compat.h 2005-03-08 23:35:53.000000000 -0600
@@ -106,3 +106,7 @@
#endif
#endif
+
+#ifndef I2C_NAME
+#define I2C_NAME(s) (s)->name
+#endif
diff -ruN ivtv-0.3.2h.orig/driver/cx25840-driver.c ivtv-0.3.2h/driver/cx25840-driver.c
--- ivtv-0.3.2h.orig/driver/cx25840-driver.c 2005-03-06 21:44:31.000000000 -0600
+++ ivtv-0.3.2h/driver/cx25840-driver.c 2005-03-08 23:30:57.000000000 -0600
@@ -1570,8 +1570,7 @@
client->adapter = adapter;
client->driver = &i2c_driver_cx25840;
client->flags = I2C_CLIENT_ALLOW_USE;
- client->id = cx25840_i2c_id++;
- snprintf(client->name, sizeof(client->name) - 1, "cx25840[%d]", client->id);
+ snprintf(client->name, sizeof(client->name) - 1, "cx25840[%d]", sizeof(I2C_NAME(client)));
state = kmalloc(sizeof(struct cx25840_state), GFP_KERNEL);
i2c_set_clientdata(client, state);
diff -ruN ivtv-0.3.2h.orig/driver/cx25840.c ivtv-0.3.2h/driver/cx25840.c
--- ivtv-0.3.2h.orig/driver/cx25840.c 2004-11-20 13:50:25.000000000 -0600
+++ ivtv-0.3.2h/driver/cx25840.c 2005-03-08 23:34:59.000000000 -0600
@@ -1354,9 +1354,8 @@
client->adapter = adapter;
client->driver = &i2c_driver_cx25840;
client->flags = I2C_CLIENT_ALLOW_USE;
- client->id = cx25840_i2c_id++;
snprintf(client->name, sizeof(client->name) - 1, "cx25840[%d]",
- client->id);
+ sizeof(I2C_NAME(client)));
state = kmalloc(sizeof(struct cx25840_state), GFP_KERNEL);
i2c_set_clientdata(client, state);
diff -ruN ivtv-0.3.2h.orig/driver/ivtv-i2c.c ivtv-0.3.2h/driver/ivtv-i2c.c
--- ivtv-0.3.2h.orig/driver/ivtv-i2c.c 2005-03-05 12:32:39.000000000 -0600
+++ ivtv-0.3.2h/driver/ivtv-i2c.c 2005-03-08 23:36:34.000000000 -0600
@@ -164,7 +164,6 @@
static struct i2c_client ivtv_i2c_client_template = {
.name = "ivtv internal use only",
- .id = -1,
};
diff -ruN ivtv-0.3.2h.orig/driver/saa7115.c ivtv-0.3.2h/driver/saa7115.c
--- ivtv-0.3.2h.orig/driver/saa7115.c 2005-03-01 09:35:52.000000000 -0600
+++ ivtv-0.3.2h/driver/saa7115.c 2005-03-08 23:38:00.000000000 -0600
@@ -1106,7 +1106,6 @@
I2C_CLIENT_INSMOD;
-static int saa7115_i2c_id = 0;
struct i2c_driver i2c_driver_saa7115;
static int
@@ -1135,9 +1134,8 @@
client->adapter = adapter;
client->driver = &i2c_driver_saa7115;
client->flags = I2C_CLIENT_ALLOW_USE;
- client->id = saa7115_i2c_id++;
snprintf(client->name, sizeof(client->name) - 1, "saa7115[%d]",
- client->id);
+ sizeof(I2C_NAME(client)));
state = kmalloc(sizeof(struct saa7115_state), GFP_KERNEL);
i2c_set_clientdata(client, state);
diff -ruN ivtv-0.3.2h.orig/driver/saa7127.c ivtv-0.3.2h/driver/saa7127.c
--- ivtv-0.3.2h.orig/driver/saa7127.c 2004-12-17 11:22:12.000000000 -0600
+++ ivtv-0.3.2h/driver/saa7127.c 2005-03-08 23:32:47.000000000 -0600
@@ -756,8 +756,7 @@
client->adapter = adapter;
client->driver = &i2c_driver_saa7127;
client->flags = I2C_CLIENT_ALLOW_USE;
- client->id = saa7127_i2c_id++;
- snprintf(client->name, sizeof(client->name) - 1, "saa7127[%d]", client->id);
+ snprintf(client->name, sizeof(client->name) - 1, "saa7127[%d]", sizeof(I2C_NAME(client)));
encoder = kmalloc(sizeof(struct saa7127), GFP_KERNEL);
diff -ruN ivtv-0.3.2h.orig/driver/tveeprom.c ivtv-0.3.2h/driver/tveeprom.c
--- ivtv-0.3.2h.orig/driver/tveeprom.c 2005-03-01 09:45:52.000000000 -0600
+++ ivtv-0.3.2h/driver/tveeprom.c 2005-03-08 23:37:25.000000000 -0600
@@ -583,7 +583,6 @@
I2C_CLIENT_INSMOD;
-static int tveeprom_i2c_id = 0;
struct i2c_driver i2c_driver_tveeprom;
static int
@@ -612,9 +611,8 @@
client->adapter = adapter;
client->driver = &i2c_driver_tveeprom;
client->flags = I2C_CLIENT_ALLOW_USE;
- client->id = tveeprom_i2c_id++;
snprintf(client->name, sizeof(client->name) - 1, "tveeprom[%d]",
- client->id);
+ sizeof(I2C_NAME(client)));
eeprom = kmalloc(sizeof(struct tveeprom), GFP_KERNEL);
if (eeprom == NULL) {
diff -ruN ivtv-0.3.2h.orig/driver/wm8775.c ivtv-0.3.2h/driver/wm8775.c
--- ivtv-0.3.2h.orig/driver/wm8775.c 2005-03-05 13:05:05.000000000 -0600
+++ ivtv-0.3.2h/driver/wm8775.c 2005-03-08 23:37:06.000000000 -0600
@@ -368,7 +368,6 @@
I2C_CLIENT_INSMOD;
-static int i2c_id = 0;
struct i2c_driver i2c_driver;
static int detect_client (struct i2c_adapter *adapter,
@@ -394,9 +393,8 @@
client->adapter = adapter;
client->driver = &i2c_driver;
client->flags = I2C_CLIENT_ALLOW_USE;
- client->id = i2c_id++;
snprintf(client->name, sizeof(client->name) - 1, MOD_NAME "[%d]",
- client->id);
+ sizeof(I2C_NAME(client)));
{
wm8775_reg_set *state;