regulator: correct name used in debug consumer regulator_get call

Call rdev_get_name() to obtain the name to use in the debug
consumer's regulator_get() call so that the debug consumer finds
the correct regulator when the name differs in the constraints
and desc structs.

Change-Id: Id6a47467cd118c89c8f58d1120381d4c64f8efee
CRs-Fixed: 1075693
Signed-off-by: David Collins <collinsd@codeaurora.org>
This commit is contained in:
David Collins 2016-10-07 11:52:47 -07:00
parent 3c7400dc73
commit 7ff3a4cc82

View file

@ -4223,7 +4223,7 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
debugfs_create_file("consumers", 0444, rdev->debugfs, rdev,
&reg_consumers_fops);
reg = regulator_get(NULL, rdev->desc->name);
reg = regulator_get(NULL, rdev_get_name(rdev));
if (IS_ERR(reg) || reg == NULL) {
pr_err("Error-Bad Function Input\n");
goto error;