summaryrefslogtreecommitdiff
path: root/drivers/mfd/88pm860x-core.c
diff options
context:
space:
mode:
authorJett.Zhou <jtzhou@marvell.com>2012-02-28 10:58:42 +0800
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-06 18:46:52 +0100
commit78258064747a5d4570400955b1ad55d5d13909e4 (patch)
tree3644ad85f1f7f12d2454506cf5255381a35dc436 /drivers/mfd/88pm860x-core.c
parent23de435a59b37eda468472ac67179eee5ef10a07 (diff)
downloadlwn-78258064747a5d4570400955b1ad55d5d13909e4.tar.gz
lwn-78258064747a5d4570400955b1ad55d5d13909e4.zip
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/88pm860x-core.c')
-rw-r--r--drivers/mfd/88pm860x-core.c17
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:
return;
}
+static void __devinit device_8606_init(struct pm860x_chip *chip,
+ struct i2c_client *i2c,
+ struct pm860x_platform_data *pdata)
+{
+ device_osc_init(i2c);
+ device_bk_init(chip, pdata);
+ device_led_init(chip, pdata);
+}
+
int __devinit pm860x_device_init(struct pm860x_chip *chip,
struct pm860x_platform_data *pdata)
{
@@ -867,9 +876,7 @@ int __devinit pm860x_device_init(struct pm860x_chip *chip,
switch (chip->id) {
case CHIP_PM8606:
- device_osc_init(chip->client);
- device_bk_init(chip, pdata);
- device_led_init(chip, pdata);
+ device_8606_init(chip, chip->client, pdata);
break;
case CHIP_PM8607:
device_8607_init(chip, chip->client, pdata);
@@ -879,9 +886,7 @@ int __devinit pm860x_device_init(struct pm860x_chip *chip,
if (chip->companion) {
switch (chip->id) {
case CHIP_PM8607:
- device_osc_init(chip->companion);
- device_bk_init(chip, pdata);
- device_led_init(chip, pdata);
+ device_8606_init(chip, chip->companion, pdata);
break;
case CHIP_PM8606:
device_8607_init(chip, chip->companion, pdata);