i2c: Add support for device alias names

Based on earlier work by Jon Smirl and Jochen Friedrich.

This patch allows new-style i2c chip drivers to have alias names using
the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this
point, the old i2c driver binding scheme (driver_name/type) is still
supported.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Jochen Friedrich <jochen@scram.de>
Cc: Jon Smirl <jonsmirl@gmail.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
此提交包含在:
Jean Delvare
2008-04-29 23:11:39 +02:00
提交者 Jean Delvare
父節點 ee56d97742
當前提交 d2653e9273
共有 43 個檔案被更改,包括 146 行新增54 行删除

查看文件

@@ -710,7 +710,8 @@ EXPORT_SYMBOL(v4l2_chip_ident_i2c_client);
/* Helper function for I2C legacy drivers */
int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver *driver,
const char *name, int (*probe)(struct i2c_client *))
const char *name,
int (*probe)(struct i2c_client *, const struct i2c_device_id *))
{
struct i2c_client *client;
int err;
@@ -724,7 +725,7 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver
client->driver = driver;
strlcpy(client->name, name, sizeof(client->name));
err = probe(client);
err = probe(client, NULL);
if (err == 0) {
i2c_attach_client(client);
} else {