diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-04-29 17:11:39 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2008-04-29 17:11:39 -0400 |
commit | d2653e92732bd3911feff6bee5e23dbf959381db (patch) | |
tree | fd3a413bc150855a09de29b2d253b7dbeb2705ff /drivers/media/video/v4l2-common.c | |
parent | ee56d977423a58b53fd0fc1ef0aca0c9cb564c53 (diff) |
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>
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r-- | drivers/media/video/v4l2-common.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index 7cc42c1da457..e9dd996fd5df 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c | |||
@@ -710,7 +710,8 @@ EXPORT_SYMBOL(v4l2_chip_ident_i2c_client); | |||
710 | /* Helper function for I2C legacy drivers */ | 710 | /* Helper function for I2C legacy drivers */ |
711 | 711 | ||
712 | int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver *driver, | 712 | int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver *driver, |
713 | const char *name, int (*probe)(struct i2c_client *)) | 713 | const char *name, |
714 | int (*probe)(struct i2c_client *, const struct i2c_device_id *)) | ||
714 | { | 715 | { |
715 | struct i2c_client *client; | 716 | struct i2c_client *client; |
716 | int err; | 717 | int err; |
@@ -724,7 +725,7 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver | |||
724 | client->driver = driver; | 725 | client->driver = driver; |
725 | strlcpy(client->name, name, sizeof(client->name)); | 726 | strlcpy(client->name, name, sizeof(client->name)); |
726 | 727 | ||
727 | err = probe(client); | 728 | err = probe(client, NULL); |
728 | if (err == 0) { | 729 | if (err == 0) { |
729 | i2c_attach_client(client); | 730 | i2c_attach_client(client); |
730 | } else { | 731 | } else { |