From: Greg Kroah-Hartman Date: Tue, 1 Apr 2003 03:48:21 +0000 (-0800) Subject: [PATCH] i2c: change the way i2c creates the bus ids to actually be unique now. X-Git-Tag: v2.5.67~35^2~9 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=6fb80bd62144790a5d4ee3ef4e10b6b2c1ea1afc;p=history.git [PATCH] i2c: change the way i2c creates the bus ids to actually be unique now. It also is much like the old naming scheme, to keep things consistent. --- diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index e838d1922b45..91ffc07d5a3c 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -392,7 +392,8 @@ int i2c_attach_client(struct i2c_client *client) client->dev.driver = &client->driver->driver; client->dev.bus = &i2c_bus_type; - snprintf(&client->dev.bus_id[0], sizeof(client->dev.bus_id), "i2c_dev_%d", i); + snprintf(&client->dev.bus_id[0], sizeof(client->dev.bus_id), + "%d-%04x", i2c_adapter_id(adapter), client->addr); printk("registering %s\n", client->dev.bus_id); device_register(&client->dev);