diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2013-01-03 01:31:02 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-01-03 06:28:52 -0500 |
commit | 3b0e8f128190982e2a8872e208723de09538e36b (patch) | |
tree | 489944777bdfdc5ae498aa648f097f580c9aaa79 /drivers/regulator/lp8788-buck.c | |
parent | a49f0d1ea3ec94fc7cf33a7c36a16343b74bd565 (diff) |
lp8788-buck: fix a parent deivce in _probe()
The lp8788-buck is a platform driver of lp8788-mfd.
The platform device is allocated when mfd_add_devices() is called
in lp8788-mfd.
On the other hand, 'lp->dev' is the i2c client device.
Therefore, this 'platform_device' is a proper parent device in case of
resource managed mem alloc, registering a regulator and device kernel message.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/lp8788-buck.c')
-rw-r--r-- | drivers/regulator/lp8788-buck.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c index aef3f2b0c5ea..4916a55d4d6f 100644 --- a/drivers/regulator/lp8788-buck.c +++ b/drivers/regulator/lp8788-buck.c | |||
@@ -503,7 +503,7 @@ static int lp8788_buck_probe(struct platform_device *pdev) | |||
503 | struct regulator_dev *rdev; | 503 | struct regulator_dev *rdev; |
504 | int ret; | 504 | int ret; |
505 | 505 | ||
506 | buck = devm_kzalloc(lp->dev, sizeof(struct lp8788_buck), GFP_KERNEL); | 506 | buck = devm_kzalloc(&pdev->dev, sizeof(struct lp8788_buck), GFP_KERNEL); |
507 | if (!buck) | 507 | if (!buck) |
508 | return -ENOMEM; | 508 | return -ENOMEM; |
509 | 509 | ||
@@ -513,7 +513,7 @@ static int lp8788_buck_probe(struct platform_device *pdev) | |||
513 | if (ret) | 513 | if (ret) |
514 | return ret; | 514 | return ret; |
515 | 515 | ||
516 | cfg.dev = lp->dev; | 516 | cfg.dev = pdev->dev.parent; |
517 | cfg.init_data = lp->pdata ? lp->pdata->buck_data[id] : NULL; | 517 | cfg.init_data = lp->pdata ? lp->pdata->buck_data[id] : NULL; |
518 | cfg.driver_data = buck; | 518 | cfg.driver_data = buck; |
519 | cfg.regmap = lp->regmap; | 519 | cfg.regmap = lp->regmap; |
@@ -521,7 +521,7 @@ static int lp8788_buck_probe(struct platform_device *pdev) | |||
521 | rdev = regulator_register(&lp8788_buck_desc[id], &cfg); | 521 | rdev = regulator_register(&lp8788_buck_desc[id], &cfg); |
522 | if (IS_ERR(rdev)) { | 522 | if (IS_ERR(rdev)) { |
523 | ret = PTR_ERR(rdev); | 523 | ret = PTR_ERR(rdev); |
524 | dev_err(lp->dev, "BUCK%d regulator register err = %d\n", | 524 | dev_err(&pdev->dev, "BUCK%d regulator register err = %d\n", |
525 | id + 1, ret); | 525 | id + 1, ret); |
526 | return ret; | 526 | return ret; |
527 | } | 527 | } |