diff options
author | Jett.Zhou <jtzhou@marvell.com> | 2012-02-27 21:58:42 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-03-06 12:46:52 -0500 |
commit | 78258064747a5d4570400955b1ad55d5d13909e4 (patch) | |
tree | 3644ad85f1f7f12d2454506cf5255381a35dc436 /drivers/mfd | |
parent | 23de435a59b37eda468472ac67179eee5ef10a07 (diff) |
mfd: Code cleanup for pm8606 sub-dev initialization
Collect all the sub-devices of pm8606 initialization into
device_pm8606_init() for code clean up.
Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/88pm860x-core.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c index 78c3a9e1fa1e..6ed8de71c983 100644 --- a/drivers/mfd/88pm860x-core.c +++ b/drivers/mfd/88pm860x-core.c | |||
@@ -860,6 +860,15 @@ out: | |||
860 | return; | 860 | return; |
861 | } | 861 | } |
862 | 862 | ||
863 | static void __devinit device_8606_init(struct pm860x_chip *chip, | ||
864 | struct i2c_client *i2c, | ||
865 | struct pm860x_platform_data *pdata) | ||
866 | { | ||
867 | device_osc_init(i2c); | ||
868 | device_bk_init(chip, pdata); | ||
869 | device_led_init(chip, pdata); | ||
870 | } | ||
871 | |||
863 | int __devinit pm860x_device_init(struct pm860x_chip *chip, | 872 | int __devinit pm860x_device_init(struct pm860x_chip *chip, |
864 | struct pm860x_platform_data *pdata) | 873 | struct pm860x_platform_data *pdata) |
865 | { | 874 | { |
@@ -867,9 +876,7 @@ int __devinit pm860x_device_init(struct pm860x_chip *chip, | |||
867 | 876 | ||
868 | switch (chip->id) { | 877 | switch (chip->id) { |
869 | case CHIP_PM8606: | 878 | case CHIP_PM8606: |
870 | device_osc_init(chip->client); | 879 | device_8606_init(chip, chip->client, pdata); |
871 | device_bk_init(chip, pdata); | ||
872 | device_led_init(chip, pdata); | ||
873 | break; | 880 | break; |
874 | case CHIP_PM8607: | 881 | case CHIP_PM8607: |
875 | device_8607_init(chip, chip->client, pdata); | 882 | device_8607_init(chip, chip->client, pdata); |
@@ -879,9 +886,7 @@ int __devinit pm860x_device_init(struct pm860x_chip *chip, | |||
879 | if (chip->companion) { | 886 | if (chip->companion) { |
880 | switch (chip->id) { | 887 | switch (chip->id) { |
881 | case CHIP_PM8607: | 888 | case CHIP_PM8607: |
882 | device_osc_init(chip->companion); | 889 | device_8606_init(chip, chip->companion, pdata); |
883 | device_bk_init(chip, pdata); | ||
884 | device_led_init(chip, pdata); | ||
885 | break; | 890 | break; |
886 | case CHIP_PM8606: | 891 | case CHIP_PM8606: |
887 | device_8607_init(chip, chip->companion, pdata); | 892 | device_8607_init(chip, chip->companion, pdata); |