diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2017-05-23 09:32:13 +0530 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-06-22 03:15:30 +0200 |
commit | 1fae788ed640e2a961c2edab54bfd56c73e2506a (patch) | |
tree | 1ae76cff96fcc95562e316da4907de7b0ca1f91a /drivers/base | |
parent | 688a48b0d27000167e0450bc1243e29a560395ca (diff) | |
download | talos-op-linux-1fae788ed640e2a961c2edab54bfd56c73e2506a.tar.gz talos-op-linux-1fae788ed640e2a961c2edab54bfd56c73e2506a.zip |
PM / OPP: Don't create debugfs "supply-0" directory unnecessarily
We create "supply-0" debugfs directory even if the device doesn't do
voltage scaling. That looks confusing, as if the regulator is found but
we never managed to get voltage levels for it.
Avoid creating such a directory unnecessarily.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/opp/debugfs.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/base/power/opp/debugfs.c b/drivers/base/power/opp/debugfs.c index 95f433db4ac7..81cf120fcf43 100644 --- a/drivers/base/power/opp/debugfs.c +++ b/drivers/base/power/opp/debugfs.c @@ -40,11 +40,10 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp, struct dentry *pdentry) { struct dentry *d; - int i = 0; + int i; char *name; - /* Always create at least supply-0 directory */ - do { + for (i = 0; i < opp_table->regulator_count; i++) { name = kasprintf(GFP_KERNEL, "supply-%d", i); /* Create per-opp directory */ @@ -70,7 +69,7 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp, if (!debugfs_create_ulong("u_amp", S_IRUGO, d, &opp->supplies[i].u_amp)) return false; - } while (++i < opp_table->regulator_count); + } return true; } |