diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-05-18 14:49:40 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2008-05-18 14:49:40 -0400 |
commit | af294867a52bf718df835a688e8c786d550bee26 (patch) | |
tree | 9800d202fd40ba2f8978d3138e28319460038802 /drivers/media/video/msp3400-driver.c | |
parent | 238a871e41ffbd9ba6608cac7c8b74549ac3bb9b (diff) |
i2c: Convert remaining new-style drivers to use module aliasing
Update all the remaining new-style i2c drivers to use standard module
aliasing instead of the old driver_name/type driver matching scheme.
Note that the tuner driver is a bit quirky at the moment, as it
overwrites i2c_client.name with arbitrary strings. We write "tuner"
back on remove, to make sure that driver cycling will work properly,
but there may still be troublesome corner cases.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/media/video/msp3400-driver.c')
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index e6273162e123..310dbaba55ff 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -815,7 +815,8 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
815 | int msp_product, msp_prod_hi, msp_prod_lo; | 815 | int msp_product, msp_prod_hi, msp_prod_lo; |
816 | int msp_rom; | 816 | int msp_rom; |
817 | 817 | ||
818 | snprintf(client->name, sizeof(client->name) - 1, "msp3400"); | 818 | if (!id) |
819 | strlcpy(client->name, "msp3400", sizeof(client->name)); | ||
819 | 820 | ||
820 | if (msp_reset(client) == -1) { | 821 | if (msp_reset(client) == -1) { |
821 | v4l_dbg(1, msp_debug, client, "msp3400 not found\n"); | 822 | v4l_dbg(1, msp_debug, client, "msp3400 not found\n"); |
@@ -864,9 +865,6 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
864 | msp_revision = (state->rev1 & 0x0f) + '@'; | 865 | msp_revision = (state->rev1 & 0x0f) + '@'; |
865 | msp_hard = ((state->rev1 >> 8) & 0xff) + '@'; | 866 | msp_hard = ((state->rev1 >> 8) & 0xff) + '@'; |
866 | msp_rom = state->rev2 & 0x1f; | 867 | msp_rom = state->rev2 & 0x1f; |
867 | snprintf(client->name, sizeof(client->name), "MSP%d4%02d%c-%c%d", | ||
868 | msp_family, msp_product, | ||
869 | msp_revision, msp_hard, msp_rom); | ||
870 | /* Rev B=2, C=3, D=4, G=7 */ | 868 | /* Rev B=2, C=3, D=4, G=7 */ |
871 | state->ident = msp_family * 10000 + 4000 + msp_product * 10 + | 869 | state->ident = msp_family * 10000 + 4000 + msp_product * 10 + |
872 | msp_revision - '@'; | 870 | msp_revision - '@'; |
@@ -931,7 +929,9 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
931 | } | 929 | } |
932 | 930 | ||
933 | /* hello world :-) */ | 931 | /* hello world :-) */ |
934 | v4l_info(client, "%s found @ 0x%x (%s)\n", client->name, | 932 | v4l_info(client, "MSP%d4%02d%c-%c%d found @ 0x%x (%s)\n", |
933 | msp_family, msp_product, | ||
934 | msp_revision, msp_hard, msp_rom, | ||
935 | client->addr << 1, client->adapter->name); | 935 | client->addr << 1, client->adapter->name); |
936 | v4l_info(client, "%s ", client->name); | 936 | v4l_info(client, "%s ", client->name); |
937 | if (state->has_nicam && state->has_radio) | 937 | if (state->has_nicam && state->has_radio) |
@@ -987,6 +987,12 @@ static int msp_remove(struct i2c_client *client) | |||
987 | 987 | ||
988 | /* ----------------------------------------------------------------------- */ | 988 | /* ----------------------------------------------------------------------- */ |
989 | 989 | ||
990 | static const struct i2c_device_id msp_id[] = { | ||
991 | { "msp3400", 0 }, | ||
992 | { } | ||
993 | }; | ||
994 | MODULE_DEVICE_TABLE(i2c, msp_id); | ||
995 | |||
990 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { | 996 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { |
991 | .name = "msp3400", | 997 | .name = "msp3400", |
992 | .driverid = I2C_DRIVERID_MSP3400, | 998 | .driverid = I2C_DRIVERID_MSP3400, |
@@ -995,6 +1001,7 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = { | |||
995 | .remove = msp_remove, | 1001 | .remove = msp_remove, |
996 | .suspend = msp_suspend, | 1002 | .suspend = msp_suspend, |
997 | .resume = msp_resume, | 1003 | .resume = msp_resume, |
1004 | .id_table = msp_id, | ||
998 | }; | 1005 | }; |
999 | 1006 | ||
1000 | 1007 | ||