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

Commit 2bec52a4 authored by Tirupathi Reddy's avatar Tirupathi Reddy
Browse files

regulator: core: fix debugfs file creation



Fix debugfs file creation for the regulators that are being
registered before their supplies.

CRs-Fixed: 2155219
Change-Id: I7ce85b8c3706601f33d1e25fd5b16f11a6f05ad2
Signed-off-by: default avatarTirupathi Reddy <tirupath@codeaurora.org>
parent 2fed71ce
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -4184,6 +4184,7 @@ static void rdev_deinit_debugfs(struct regulator_dev *rdev)
		debugfs_remove_recursive(rdev->debugfs);
		if (rdev->debug_consumer)
			rdev->debug_consumer->debugfs = NULL;
		rdev->debugfs = NULL;
		regulator_put(rdev->debug_consumer);
	}
}
@@ -4225,7 +4226,8 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)

	regulator = regulator_get(NULL, rdev_get_name(rdev));
	if (IS_ERR(regulator)) {
		debugfs_remove_recursive(rdev->debugfs);
		rdev_deinit_debugfs(rdev);
		if (PTR_ERR(regulator) != -EPROBE_DEFER)
			rdev_err(rdev, "regulator get failed, ret=%ld\n",
				 PTR_ERR(regulator));
		return;