diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2013-01-03 01:32:11 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-01-03 06:28:53 -0500 |
commit | 939e88f0909a4dd76cf75b9bda6ee905c04a162f (patch) | |
tree | 1c5175453e32b5437cd6a15f5e1e9d6ec4ff7cf4 /drivers/regulator | |
parent | 1ef01e74e78ce445af168a18c6a196642e25e23b (diff) |
lp8788-ldo: fix a parent device in _probe()
The lp8788-ldo 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 regulators and device kernel messages.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/lp8788-ldo.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/regulator/lp8788-ldo.c b/drivers/regulator/lp8788-ldo.c index 3792741708ce..40403e9f83b6 100644 --- a/drivers/regulator/lp8788-ldo.c +++ b/drivers/regulator/lp8788-ldo.c | |||
@@ -712,7 +712,7 @@ static int lp8788_dldo_probe(struct platform_device *pdev) | |||
712 | struct regulator_dev *rdev; | 712 | struct regulator_dev *rdev; |
713 | int ret; | 713 | int ret; |
714 | 714 | ||
715 | ldo = devm_kzalloc(lp->dev, sizeof(struct lp8788_ldo), GFP_KERNEL); | 715 | ldo = devm_kzalloc(&pdev->dev, sizeof(struct lp8788_ldo), GFP_KERNEL); |
716 | if (!ldo) | 716 | if (!ldo) |
717 | return -ENOMEM; | 717 | return -ENOMEM; |
718 | 718 | ||
@@ -721,7 +721,7 @@ static int lp8788_dldo_probe(struct platform_device *pdev) | |||
721 | if (ret) | 721 | if (ret) |
722 | return ret; | 722 | return ret; |
723 | 723 | ||
724 | cfg.dev = lp->dev; | 724 | cfg.dev = pdev->dev.parent; |
725 | cfg.init_data = lp->pdata ? lp->pdata->dldo_data[id] : NULL; | 725 | cfg.init_data = lp->pdata ? lp->pdata->dldo_data[id] : NULL; |
726 | cfg.driver_data = ldo; | 726 | cfg.driver_data = ldo; |
727 | cfg.regmap = lp->regmap; | 727 | cfg.regmap = lp->regmap; |
@@ -729,7 +729,7 @@ static int lp8788_dldo_probe(struct platform_device *pdev) | |||
729 | rdev = regulator_register(&lp8788_dldo_desc[id], &cfg); | 729 | rdev = regulator_register(&lp8788_dldo_desc[id], &cfg); |
730 | if (IS_ERR(rdev)) { | 730 | if (IS_ERR(rdev)) { |
731 | ret = PTR_ERR(rdev); | 731 | ret = PTR_ERR(rdev); |
732 | dev_err(lp->dev, "DLDO%d regulator register err = %d\n", | 732 | dev_err(&pdev->dev, "DLDO%d regulator register err = %d\n", |
733 | id + 1, ret); | 733 | id + 1, ret); |
734 | return ret; | 734 | return ret; |
735 | } | 735 | } |
@@ -768,7 +768,7 @@ static int lp8788_aldo_probe(struct platform_device *pdev) | |||
768 | struct regulator_dev *rdev; | 768 | struct regulator_dev *rdev; |
769 | int ret; | 769 | int ret; |
770 | 770 | ||
771 | ldo = devm_kzalloc(lp->dev, sizeof(struct lp8788_ldo), GFP_KERNEL); | 771 | ldo = devm_kzalloc(&pdev->dev, sizeof(struct lp8788_ldo), GFP_KERNEL); |
772 | if (!ldo) | 772 | if (!ldo) |
773 | return -ENOMEM; | 773 | return -ENOMEM; |
774 | 774 | ||
@@ -777,7 +777,7 @@ static int lp8788_aldo_probe(struct platform_device *pdev) | |||
777 | if (ret) | 777 | if (ret) |
778 | return ret; | 778 | return ret; |
779 | 779 | ||
780 | cfg.dev = lp->dev; | 780 | cfg.dev = pdev->dev.parent; |
781 | cfg.init_data = lp->pdata ? lp->pdata->aldo_data[id] : NULL; | 781 | cfg.init_data = lp->pdata ? lp->pdata->aldo_data[id] : NULL; |
782 | cfg.driver_data = ldo; | 782 | cfg.driver_data = ldo; |
783 | cfg.regmap = lp->regmap; | 783 | cfg.regmap = lp->regmap; |
@@ -785,7 +785,7 @@ static int lp8788_aldo_probe(struct platform_device *pdev) | |||
785 | rdev = regulator_register(&lp8788_aldo_desc[id], &cfg); | 785 | rdev = regulator_register(&lp8788_aldo_desc[id], &cfg); |
786 | if (IS_ERR(rdev)) { | 786 | if (IS_ERR(rdev)) { |
787 | ret = PTR_ERR(rdev); | 787 | ret = PTR_ERR(rdev); |
788 | dev_err(lp->dev, "ALDO%d regulator register err = %d\n", | 788 | dev_err(&pdev->dev, "ALDO%d regulator register err = %d\n", |
789 | id + 1, ret); | 789 | id + 1, ret); |
790 | return ret; | 790 | return ret; |
791 | } | 791 | } |