Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b0e8f12 authored by Kim, Milo's avatar Kim, Milo Committed by Mark Brown
Browse files

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: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent a49f0d1e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -503,7 +503,7 @@ static int lp8788_buck_probe(struct platform_device *pdev)
	struct regulator_dev *rdev;
	int ret;

	buck = devm_kzalloc(lp->dev, sizeof(struct lp8788_buck), GFP_KERNEL);
	buck = devm_kzalloc(&pdev->dev, sizeof(struct lp8788_buck), GFP_KERNEL);
	if (!buck)
		return -ENOMEM;

@@ -513,7 +513,7 @@ static int lp8788_buck_probe(struct platform_device *pdev)
	if (ret)
		return ret;

	cfg.dev = lp->dev;
	cfg.dev = pdev->dev.parent;
	cfg.init_data = lp->pdata ? lp->pdata->buck_data[id] : NULL;
	cfg.driver_data = buck;
	cfg.regmap = lp->regmap;
@@ -521,7 +521,7 @@ static int lp8788_buck_probe(struct platform_device *pdev)
	rdev = regulator_register(&lp8788_buck_desc[id], &cfg);
	if (IS_ERR(rdev)) {
		ret = PTR_ERR(rdev);
		dev_err(lp->dev, "BUCK%d regulator register err = %d\n",
		dev_err(&pdev->dev, "BUCK%d regulator register err = %d\n",
				id + 1, ret);
		return ret;
	}