Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282191
b: refs/heads/master
c: 984b5a6
h: refs/heads/master
i:
  282189: ec5b2bd
  282187: 60f44e5
  282183: e745b2e
  282175: d08ff35
v: v3
  • Loading branch information
Ashish Jangam authored and Mark Brown committed Dec 17, 2011
1 parent 773d0c4 commit 1ad1587
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47aed92c7740c33f3acbd9dbdefb5ec6f9effdc0
refs/heads/master: 984b5a6ba550f41edda86d0b6deba2b5187f5e44
16 changes: 11 additions & 5 deletions trunk/drivers/regulator/da9052-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,18 +505,23 @@ static inline struct da9052_regulator_info *find_regulator_info(u8 chip_id,
struct da9052_regulator_info *info;
int i;

if (chip_id == DA9052) {
switch (chip_id) {
case DA9052:
for (i = 0; i < ARRAY_SIZE(da9052_regulator_info); i++) {
info = &da9052_regulator_info[i];
if (info->reg_desc.id == id)
return info;
}
} else {
break;
case DA9053_AA:
case DA9053_BA:
case DA9053_BB:
for (i = 0; i < ARRAY_SIZE(da9053_regulator_info); i++) {
info = &da9053_regulator_info[i];
if (info->reg_desc.id == id)
return info;
}
break;
}

return NULL;
Expand All @@ -529,7 +534,8 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
struct da9052_pdata *pdata;
int ret;

regulator = kzalloc(sizeof(struct da9052_regulator), GFP_KERNEL);
regulator = devm_kzalloc(&pdev->dev, sizeof(struct da9052_regulator),
GFP_KERNEL);
if (!regulator)
return -ENOMEM;

Expand Down Expand Up @@ -559,7 +565,7 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)

return 0;
err:
kfree(regulator);
devm_kfree(&pdev->dev, regulator);
return ret;
}

Expand All @@ -568,7 +574,7 @@ static int __devexit da9052_regulator_remove(struct platform_device *pdev)
struct da9052_regulator *regulator = platform_get_drvdata(pdev);

regulator_unregister(regulator->rdev);
kfree(regulator);
devm_kfree(&pdev->dev, regulator);

return 0;
}
Expand Down

0 comments on commit 1ad1587

Please sign in to comment.