diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-04-29 17:11:40 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2008-04-29 17:11:40 -0400 |
commit | 3760f736716f74bdc62a4ba5406934338da93eb2 (patch) | |
tree | e28e22c6655dd62566f1b7a99f9354a31bf9d06e /drivers/i2c/chips/tps65010.c | |
parent | d2653e92732bd3911feff6bee5e23dbf959381db (diff) |
i2c: Convert most new-style drivers to use module aliasing
Based on earlier work by Jon Smirl and Jochen Friedrich.
Update most new-style i2c drivers to use standard module aliasing
instead of the old driver_name/type driver matching scheme. I've
left the video drivers apart (except for SoC camera drivers) as
they're a bit more diffcult to deal with, they'll have their own
patch later.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Jon Smirl <jonsmirl@gmail.com>
Cc: Jochen Friedrich <jochen@scram.de>
Diffstat (limited to 'drivers/i2c/chips/tps65010.c')
-rw-r--r-- | drivers/i2c/chips/tps65010.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c index 6ab3619a49de..85949685191b 100644 --- a/drivers/i2c/chips/tps65010.c +++ b/drivers/i2c/chips/tps65010.c | |||
@@ -64,7 +64,6 @@ static struct i2c_driver tps65010_driver; | |||
64 | * as part of board setup by a bootloader. | 64 | * as part of board setup by a bootloader. |
65 | */ | 65 | */ |
66 | enum tps_model { | 66 | enum tps_model { |
67 | TPS_UNKNOWN = 0, | ||
68 | TPS65010, | 67 | TPS65010, |
69 | TPS65011, | 68 | TPS65011, |
70 | TPS65012, | 69 | TPS65012, |
@@ -554,20 +553,7 @@ static int tps65010_probe(struct i2c_client *client, | |||
554 | mutex_init(&tps->lock); | 553 | mutex_init(&tps->lock); |
555 | INIT_DELAYED_WORK(&tps->work, tps65010_work); | 554 | INIT_DELAYED_WORK(&tps->work, tps65010_work); |
556 | tps->client = client; | 555 | tps->client = client; |
557 | 556 | tps->model = id->driver_data; | |
558 | if (strcmp(client->name, "tps65010") == 0) | ||
559 | tps->model = TPS65010; | ||
560 | else if (strcmp(client->name, "tps65011") == 0) | ||
561 | tps->model = TPS65011; | ||
562 | else if (strcmp(client->name, "tps65012") == 0) | ||
563 | tps->model = TPS65012; | ||
564 | else if (strcmp(client->name, "tps65013") == 0) | ||
565 | tps->model = TPS65013; | ||
566 | else { | ||
567 | dev_warn(&client->dev, "unknown chip '%s'\n", client->name); | ||
568 | status = -ENODEV; | ||
569 | goto fail1; | ||
570 | } | ||
571 | 557 | ||
572 | /* the IRQ is active low, but many gpio lines can't support that | 558 | /* the IRQ is active low, but many gpio lines can't support that |
573 | * so this driver uses falling-edge triggers instead. | 559 | * so this driver uses falling-edge triggers instead. |
@@ -596,9 +582,6 @@ static int tps65010_probe(struct i2c_client *client, | |||
596 | case TPS65012: | 582 | case TPS65012: |
597 | tps->por = 1; | 583 | tps->por = 1; |
598 | break; | 584 | break; |
599 | case TPS_UNKNOWN: | ||
600 | printk(KERN_WARNING "%s: unknown TPS chip\n", DRIVER_NAME); | ||
601 | break; | ||
602 | /* else CHGCONFIG.POR is replaced by AUA, enabling a WAIT mode */ | 585 | /* else CHGCONFIG.POR is replaced by AUA, enabling a WAIT mode */ |
603 | } | 586 | } |
604 | tps->chgconf = i2c_smbus_read_byte_data(client, TPS_CHGCONFIG); | 587 | tps->chgconf = i2c_smbus_read_byte_data(client, TPS_CHGCONFIG); |
@@ -685,12 +668,22 @@ fail1: | |||
685 | return status; | 668 | return status; |
686 | } | 669 | } |
687 | 670 | ||
671 | static const struct i2c_device_id tps65010_id[] = { | ||
672 | { "tps65010", TPS65010 }, | ||
673 | { "tps65011", TPS65011 }, | ||
674 | { "tps65012", TPS65012 }, | ||
675 | { "tps65013", TPS65013 }, | ||
676 | { } | ||
677 | }; | ||
678 | MODULE_DEVICE_TABLE(i2c, tps65010_id); | ||
679 | |||
688 | static struct i2c_driver tps65010_driver = { | 680 | static struct i2c_driver tps65010_driver = { |
689 | .driver = { | 681 | .driver = { |
690 | .name = "tps65010", | 682 | .name = "tps65010", |
691 | }, | 683 | }, |
692 | .probe = tps65010_probe, | 684 | .probe = tps65010_probe, |
693 | .remove = __exit_p(tps65010_remove), | 685 | .remove = __exit_p(tps65010_remove), |
686 | .id_table = tps65010_id, | ||
694 | }; | 687 | }; |
695 | 688 | ||
696 | /*-------------------------------------------------------------------------*/ | 689 | /*-------------------------------------------------------------------------*/ |