aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-26 13:24:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-26 13:24:06 -0400
commit84a881657d391121cd88c37f0a312dec3528fa44 (patch)
treeb997a21cfa759cc2856197822e34277dbf5538a3
parent1434b65731963207a4cc84bd87e6191e34321986 (diff)
parent2548baa07ddf37ea8604e9627f042616d1cdc43e (diff)
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: i2c: Align i2c_device_id tuner: Do not alter i2c_client.name
-rw-r--r--drivers/media/video/tuner-core.c20
-rw-r--r--include/linux/mod_devicetable.h3
2 files changed, 9 insertions, 14 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 198f0afb812e..a0f7bc1edaa2 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -92,6 +92,7 @@ struct tuner {
92 unsigned int type; /* chip type id */ 92 unsigned int type; /* chip type id */
93 unsigned int config; 93 unsigned int config;
94 int (*tuner_callback) (void *dev, int command, int arg); 94 int (*tuner_callback) (void *dev, int command, int arg);
95 const char *name;
95}; 96};
96 97
97/* standard i2c insmod options */ 98/* standard i2c insmod options */
@@ -330,13 +331,13 @@ static void tuner_i2c_address_check(struct tuner *t)
330 tuner_warn("Support for tuners in i2c address range 0x64 thru 0x6f\n"); 331 tuner_warn("Support for tuners in i2c address range 0x64 thru 0x6f\n");
331 tuner_warn("will soon be dropped. This message indicates that your\n"); 332 tuner_warn("will soon be dropped. This message indicates that your\n");
332 tuner_warn("hardware has a %s tuner at i2c address 0x%02x.\n", 333 tuner_warn("hardware has a %s tuner at i2c address 0x%02x.\n",
333 t->i2c->name, t->i2c->addr); 334 t->name, t->i2c->addr);
334 tuner_warn("To ensure continued support for your device, please\n"); 335 tuner_warn("To ensure continued support for your device, please\n");
335 tuner_warn("send a copy of this message, along with full dmesg\n"); 336 tuner_warn("send a copy of this message, along with full dmesg\n");
336 tuner_warn("output to v4l-dvb-maintainer@linuxtv.org\n"); 337 tuner_warn("output to v4l-dvb-maintainer@linuxtv.org\n");
337 tuner_warn("Please use subject line: \"obsolete tuner i2c address.\"\n"); 338 tuner_warn("Please use subject line: \"obsolete tuner i2c address.\"\n");
338 tuner_warn("driver: %s, addr: 0x%02x, type: %d (%s)\n", 339 tuner_warn("driver: %s, addr: 0x%02x, type: %d (%s)\n",
339 t->i2c->adapter->name, t->i2c->addr, t->type, t->i2c->name); 340 t->i2c->adapter->name, t->i2c->addr, t->type, t->name);
340 tuner_warn("====================== WARNING! ======================\n"); 341 tuner_warn("====================== WARNING! ======================\n");
341} 342}
342 343
@@ -470,19 +471,17 @@ static void set_type(struct i2c_client *c, unsigned int type,
470 if ((NULL == analog_ops->set_params) && 471 if ((NULL == analog_ops->set_params) &&
471 (fe_tuner_ops->set_analog_params)) { 472 (fe_tuner_ops->set_analog_params)) {
472 473
473 strlcpy(t->i2c->name, fe_tuner_ops->info.name, 474 t->name = fe_tuner_ops->info.name;
474 sizeof(t->i2c->name));
475 475
476 t->fe.analog_demod_priv = t; 476 t->fe.analog_demod_priv = t;
477 memcpy(analog_ops, &tuner_core_ops, 477 memcpy(analog_ops, &tuner_core_ops,
478 sizeof(struct analog_demod_ops)); 478 sizeof(struct analog_demod_ops));
479 479
480 } else { 480 } else {
481 strlcpy(t->i2c->name, analog_ops->info.name, 481 t->name = analog_ops->info.name;
482 sizeof(t->i2c->name));
483 } 482 }
484 483
485 tuner_dbg("type set to %s\n", t->i2c->name); 484 tuner_dbg("type set to %s\n", t->name);
486 485
487 if (t->mode_mask == T_UNINITIALIZED) 486 if (t->mode_mask == T_UNINITIALIZED)
488 t->mode_mask = new_mode_mask; 487 t->mode_mask = new_mode_mask;
@@ -1115,6 +1114,7 @@ static int tuner_probe(struct i2c_client *client,
1115 if (NULL == t) 1114 if (NULL == t)
1116 return -ENOMEM; 1115 return -ENOMEM;
1117 t->i2c = client; 1116 t->i2c = client;
1117 t->name = "(tuner unset)";
1118 i2c_set_clientdata(client, t); 1118 i2c_set_clientdata(client, t);
1119 t->type = UNSET; 1119 t->type = UNSET;
1120 t->audmode = V4L2_TUNER_MODE_STEREO; 1120 t->audmode = V4L2_TUNER_MODE_STEREO;
@@ -1272,12 +1272,6 @@ static int tuner_remove(struct i2c_client *client)
1272 1272
1273 list_del(&t->list); 1273 list_del(&t->list);
1274 kfree(t); 1274 kfree(t);
1275
1276 /* The probing code has overwritten the device name, restore it so
1277 that reloading the driver will work. Ideally the device name
1278 should not be overwritten in the first place, but for now that
1279 will do. */
1280 strlcpy(client->name, "tuner", I2C_NAME_SIZE);
1281 return 0; 1275 return 0;
1282} 1276}
1283 1277
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index d73eceaa7afb..69b2342d5ebb 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -375,7 +375,8 @@ struct virtio_device_id {
375 375
376struct i2c_device_id { 376struct i2c_device_id {
377 char name[I2C_NAME_SIZE]; 377 char name[I2C_NAME_SIZE];
378 kernel_ulong_t driver_data; /* Data private to the driver */ 378 kernel_ulong_t driver_data /* Data private to the driver */
379 __attribute__((aligned(sizeof(kernel_ulong_t))));
379}; 380};
380 381
381 382