]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] i2c: change the way i2c creates the bus ids to actually be unique now.
authorGreg Kroah-Hartman <greg@kroah.com>
Tue, 1 Apr 2003 03:48:21 +0000 (19:48 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 1 Apr 2003 03:48:21 +0000 (19:48 -0800)
It also is much like the old naming scheme, to keep things consistent.

drivers/i2c/i2c-core.c

index e838d1922b459ffb309603416c3fc13f8d7020d2..91ffc07d5a3c8e13aa8554f0b9bee4730d2c0f84 100644 (file)
@@ -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);