Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302323
b: refs/heads/master
c: 84df8c1
h: refs/heads/master
i:
  302321: 1388451
  302319: 9974518
v: v3
  • Loading branch information
Laxman Dewangan authored and Mark Brown committed May 20, 2012
1 parent c4bf34d commit 1f6c015
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 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: 92ab953bd6477b816e8ddd2cf9eaed063332013a
refs/heads/master: 84df8c1241beb87fec73415ef4f6e627aca34835
19 changes: 12 additions & 7 deletions trunk/drivers/regulator/tps65910-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,8 @@ static struct of_regulator_match tps65911_matches[] = {
};

static struct tps65910_board *tps65910_parse_dt_reg_data(
struct platform_device *pdev)
struct platform_device *pdev,
struct of_regulator_match **tps65910_reg_matches)
{
struct tps65910_board *pmic_plat_data;
struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent);
Expand Down Expand Up @@ -1116,6 +1117,8 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
return NULL;
}

*tps65910_reg_matches = matches;

for (idx = 0; idx < count; idx++) {
if (!matches[idx].init_data || !matches[idx].of_node)
continue;
Expand All @@ -1133,8 +1136,10 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
}
#else
static inline struct tps65910_board *tps65910_parse_dt_reg_data(
struct platform_device *pdev)
struct platform_device *pdev,
struct of_regulator_match **tps65910_reg_matches)
{
*tps65910_reg_matches = NULL;
return 0;
}
#endif
Expand All @@ -1148,11 +1153,13 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
struct regulator_dev *rdev;
struct tps65910_reg *pmic;
struct tps65910_board *pmic_plat_data;
struct of_regulator_match *tps65910_reg_matches = NULL;
int i, err;

pmic_plat_data = dev_get_platdata(tps65910->dev);
if (!pmic_plat_data && tps65910->dev->of_node)
pmic_plat_data = tps65910_parse_dt_reg_data(pdev);
pmic_plat_data = tps65910_parse_dt_reg_data(pdev,
&tps65910_reg_matches);

if (!pmic_plat_data) {
dev_err(&pdev->dev, "Platform data not found\n");
Expand Down Expand Up @@ -1265,10 +1272,8 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
config.driver_data = pmic;
config.regmap = tps65910->regmap;

#ifdef CONFIG_OF
config.of_node = of_find_node_by_name(tps65910->dev->of_node,
info->name);
#endif
if (tps65910_reg_matches)
config.of_node = tps65910_reg_matches[i].of_node;

rdev = regulator_register(&pmic->desc[i], &config);
if (IS_ERR(rdev)) {
Expand Down

0 comments on commit 1f6c015

Please sign in to comment.