Commit 84a88165 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 1434b657 2548baa0
...@@ -92,6 +92,7 @@ struct tuner { ...@@ -92,6 +92,7 @@ struct tuner {
unsigned int type; /* chip type id */ unsigned int type; /* chip type id */
unsigned int config; unsigned int config;
int (*tuner_callback) (void *dev, int command, int arg); int (*tuner_callback) (void *dev, int command, int arg);
const char *name;
}; };
/* standard i2c insmod options */ /* standard i2c insmod options */
...@@ -330,13 +331,13 @@ static void tuner_i2c_address_check(struct tuner *t) ...@@ -330,13 +331,13 @@ static void tuner_i2c_address_check(struct tuner *t)
tuner_warn("Support for tuners in i2c address range 0x64 thru 0x6f\n"); tuner_warn("Support for tuners in i2c address range 0x64 thru 0x6f\n");
tuner_warn("will soon be dropped. This message indicates that your\n"); tuner_warn("will soon be dropped. This message indicates that your\n");
tuner_warn("hardware has a %s tuner at i2c address 0x%02x.\n", tuner_warn("hardware has a %s tuner at i2c address 0x%02x.\n",
t->i2c->name, t->i2c->addr); t->name, t->i2c->addr);
tuner_warn("To ensure continued support for your device, please\n"); tuner_warn("To ensure continued support for your device, please\n");
tuner_warn("send a copy of this message, along with full dmesg\n"); tuner_warn("send a copy of this message, along with full dmesg\n");
tuner_warn("output to v4l-dvb-maintainer@linuxtv.org\n"); tuner_warn("output to v4l-dvb-maintainer@linuxtv.org\n");
tuner_warn("Please use subject line: \"obsolete tuner i2c address.\"\n"); tuner_warn("Please use subject line: \"obsolete tuner i2c address.\"\n");
tuner_warn("driver: %s, addr: 0x%02x, type: %d (%s)\n", tuner_warn("driver: %s, addr: 0x%02x, type: %d (%s)\n",
t->i2c->adapter->name, t->i2c->addr, t->type, t->i2c->name); t->i2c->adapter->name, t->i2c->addr, t->type, t->name);
tuner_warn("====================== WARNING! ======================\n"); tuner_warn("====================== WARNING! ======================\n");
} }
...@@ -470,19 +471,17 @@ static void set_type(struct i2c_client *c, unsigned int type, ...@@ -470,19 +471,17 @@ static void set_type(struct i2c_client *c, unsigned int type,
if ((NULL == analog_ops->set_params) && if ((NULL == analog_ops->set_params) &&
(fe_tuner_ops->set_analog_params)) { (fe_tuner_ops->set_analog_params)) {
strlcpy(t->i2c->name, fe_tuner_ops->info.name, t->name = fe_tuner_ops->info.name;
sizeof(t->i2c->name));
t->fe.analog_demod_priv = t; t->fe.analog_demod_priv = t;
memcpy(analog_ops, &tuner_core_ops, memcpy(analog_ops, &tuner_core_ops,
sizeof(struct analog_demod_ops)); sizeof(struct analog_demod_ops));
} else { } else {
strlcpy(t->i2c->name, analog_ops->info.name, t->name = analog_ops->info.name;
sizeof(t->i2c->name));
} }
tuner_dbg("type set to %s\n", t->i2c->name); tuner_dbg("type set to %s\n", t->name);
if (t->mode_mask == T_UNINITIALIZED) if (t->mode_mask == T_UNINITIALIZED)
t->mode_mask = new_mode_mask; t->mode_mask = new_mode_mask;
...@@ -1115,6 +1114,7 @@ static int tuner_probe(struct i2c_client *client, ...@@ -1115,6 +1114,7 @@ static int tuner_probe(struct i2c_client *client,
if (NULL == t) if (NULL == t)
return -ENOMEM; return -ENOMEM;
t->i2c = client; t->i2c = client;
t->name = "(tuner unset)";
i2c_set_clientdata(client, t); i2c_set_clientdata(client, t);
t->type = UNSET; t->type = UNSET;
t->audmode = V4L2_TUNER_MODE_STEREO; t->audmode = V4L2_TUNER_MODE_STEREO;
...@@ -1272,12 +1272,6 @@ static int tuner_remove(struct i2c_client *client) ...@@ -1272,12 +1272,6 @@ static int tuner_remove(struct i2c_client *client)
list_del(&t->list); list_del(&t->list);
kfree(t); kfree(t);
/* The probing code has overwritten the device name, restore it so
that reloading the driver will work. Ideally the device name
should not be overwritten in the first place, but for now that
will do. */
strlcpy(client->name, "tuner", I2C_NAME_SIZE);
return 0; return 0;
} }
......
...@@ -375,7 +375,8 @@ struct virtio_device_id { ...@@ -375,7 +375,8 @@ struct virtio_device_id {
struct i2c_device_id { struct i2c_device_id {
char name[I2C_NAME_SIZE]; char name[I2C_NAME_SIZE];
kernel_ulong_t driver_data; /* Data private to the driver */ kernel_ulong_t driver_data /* Data private to the driver */
__attribute__((aligned(sizeof(kernel_ulong_t))));
}; };
......
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