diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-05-11 14:37:06 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2008-05-11 14:37:06 -0400 |
commit | ae429083efe996ca2c569c44fd6fea440676dc33 (patch) | |
tree | 85bc4b8d0e0ac034a751b652210f908ec33cc24f /drivers/media/video/tvaudio.c | |
parent | 60b129d7bfa3e20450816983bd52c49bb0bc1c21 (diff) |
i2c: Convert some more new-style drivers to use module aliasing
Update 3 more new-style i2c drivers to use standard module aliasing
instead of the old driver_name/type driver matching scheme. These
video drivers aren't used yet so converting them is trivial.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/media/video/tvaudio.c')
-rw-r--r-- | drivers/media/video/tvaudio.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index 6f9945b04e1f..c77914d99d15 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c | |||
@@ -1505,7 +1505,8 @@ static int chip_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
1505 | } | 1505 | } |
1506 | 1506 | ||
1507 | /* fill required data structures */ | 1507 | /* fill required data structures */ |
1508 | strcpy(client->name, desc->name); | 1508 | if (!id) |
1509 | strlcpy(client->name, desc->name, I2C_NAME_SIZE); | ||
1509 | chip->type = desc-chiplist; | 1510 | chip->type = desc-chiplist; |
1510 | chip->shadow.count = desc->registers+1; | 1511 | chip->shadow.count = desc->registers+1; |
1511 | chip->prevmode = -1; | 1512 | chip->prevmode = -1; |
@@ -1830,6 +1831,15 @@ static int chip_legacy_probe(struct i2c_adapter *adap) | |||
1830 | return 0; | 1831 | return 0; |
1831 | } | 1832 | } |
1832 | 1833 | ||
1834 | /* This driver supports many devices and the idea is to let the driver | ||
1835 | detect which device is present. So rather than listing all supported | ||
1836 | devices here, we pretend to support a single, fake device type. */ | ||
1837 | static const struct i2c_device_id chip_id[] = { | ||
1838 | { "tvaudio", 0 }, | ||
1839 | { } | ||
1840 | }; | ||
1841 | MODULE_DEVICE_TABLE(i2c, chip_id); | ||
1842 | |||
1833 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { | 1843 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { |
1834 | .name = "tvaudio", | 1844 | .name = "tvaudio", |
1835 | .driverid = I2C_DRIVERID_TVAUDIO, | 1845 | .driverid = I2C_DRIVERID_TVAUDIO, |
@@ -1837,6 +1847,7 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = { | |||
1837 | .probe = chip_probe, | 1847 | .probe = chip_probe, |
1838 | .remove = chip_remove, | 1848 | .remove = chip_remove, |
1839 | .legacy_probe = chip_legacy_probe, | 1849 | .legacy_probe = chip_legacy_probe, |
1850 | .id_table = chip_id, | ||
1840 | }; | 1851 | }; |
1841 | 1852 | ||
1842 | /* | 1853 | /* |