Commit 939e88f0 authored by Kim, Milo's avatar Kim, Milo Committed by Mark Brown

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: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 1ef01e74
...@@ -712,7 +712,7 @@ static int lp8788_dldo_probe(struct platform_device *pdev) ...@@ -712,7 +712,7 @@ static int lp8788_dldo_probe(struct platform_device *pdev)
struct regulator_dev *rdev; struct regulator_dev *rdev;
int ret; int ret;
ldo = devm_kzalloc(lp->dev, sizeof(struct lp8788_ldo), GFP_KERNEL); ldo = devm_kzalloc(&pdev->dev, sizeof(struct lp8788_ldo), GFP_KERNEL);
if (!ldo) if (!ldo)
return -ENOMEM; return -ENOMEM;
...@@ -721,7 +721,7 @@ static int lp8788_dldo_probe(struct platform_device *pdev) ...@@ -721,7 +721,7 @@ static int lp8788_dldo_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
cfg.dev = lp->dev; cfg.dev = pdev->dev.parent;
cfg.init_data = lp->pdata ? lp->pdata->dldo_data[id] : NULL; cfg.init_data = lp->pdata ? lp->pdata->dldo_data[id] : NULL;
cfg.driver_data = ldo; cfg.driver_data = ldo;
cfg.regmap = lp->regmap; cfg.regmap = lp->regmap;
...@@ -729,7 +729,7 @@ static int lp8788_dldo_probe(struct platform_device *pdev) ...@@ -729,7 +729,7 @@ static int lp8788_dldo_probe(struct platform_device *pdev)
rdev = regulator_register(&lp8788_dldo_desc[id], &cfg); rdev = regulator_register(&lp8788_dldo_desc[id], &cfg);
if (IS_ERR(rdev)) { if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev); ret = PTR_ERR(rdev);
dev_err(lp->dev, "DLDO%d regulator register err = %d\n", dev_err(&pdev->dev, "DLDO%d regulator register err = %d\n",
id + 1, ret); id + 1, ret);
return ret; return ret;
} }
...@@ -768,7 +768,7 @@ static int lp8788_aldo_probe(struct platform_device *pdev) ...@@ -768,7 +768,7 @@ static int lp8788_aldo_probe(struct platform_device *pdev)
struct regulator_dev *rdev; struct regulator_dev *rdev;
int ret; int ret;
ldo = devm_kzalloc(lp->dev, sizeof(struct lp8788_ldo), GFP_KERNEL); ldo = devm_kzalloc(&pdev->dev, sizeof(struct lp8788_ldo), GFP_KERNEL);
if (!ldo) if (!ldo)
return -ENOMEM; return -ENOMEM;
...@@ -777,7 +777,7 @@ static int lp8788_aldo_probe(struct platform_device *pdev) ...@@ -777,7 +777,7 @@ static int lp8788_aldo_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
cfg.dev = lp->dev; cfg.dev = pdev->dev.parent;
cfg.init_data = lp->pdata ? lp->pdata->aldo_data[id] : NULL; cfg.init_data = lp->pdata ? lp->pdata->aldo_data[id] : NULL;
cfg.driver_data = ldo; cfg.driver_data = ldo;
cfg.regmap = lp->regmap; cfg.regmap = lp->regmap;
...@@ -785,7 +785,7 @@ static int lp8788_aldo_probe(struct platform_device *pdev) ...@@ -785,7 +785,7 @@ static int lp8788_aldo_probe(struct platform_device *pdev)
rdev = regulator_register(&lp8788_aldo_desc[id], &cfg); rdev = regulator_register(&lp8788_aldo_desc[id], &cfg);
if (IS_ERR(rdev)) { if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev); ret = PTR_ERR(rdev);
dev_err(lp->dev, "ALDO%d regulator register err = %d\n", dev_err(&pdev->dev, "ALDO%d regulator register err = %d\n",
id + 1, ret); id + 1, ret);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment