summaryrefslogtreecommitdiffstats
path: root/drivers/opp/debugfs.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2023-06-14 12:27:43 +0200
committerViresh Kumar <viresh.kumar@linaro.org>2023-06-19 06:20:02 +0200
commit84cb7ff35fcf7c0b552f553a3f2db9c3e92fc707 (patch)
tree491fdd3db54ade951a5664d75f007ab8b98c8639 /drivers/opp/debugfs.c
parentOPP: don't drop performance constraint on OPP table removal (diff)
downloadlinux-84cb7ff35fcf7c0b552f553a3f2db9c3e92fc707.tar.xz
linux-84cb7ff35fcf7c0b552f553a3f2db9c3e92fc707.zip
OPP: pstate is only valid for genpd OPP tables
It is not very clear right now that the `pstate` field is only valid for genpd OPP tables and not consumer tables. And there is no checking for the same at various places. Add checks in place to verify that and make it clear to the reader. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com> Tested-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Diffstat (limited to 'drivers/opp/debugfs.c')
-rw-r--r--drivers/opp/debugfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/opp/debugfs.c b/drivers/opp/debugfs.c
index 2c7fb683441e..0cc21e2b42ff 100644
--- a/drivers/opp/debugfs.c
+++ b/drivers/opp/debugfs.c
@@ -152,11 +152,13 @@ void opp_debug_create_one(struct dev_pm_opp *opp, struct opp_table *opp_table)
debugfs_create_bool("dynamic", S_IRUGO, d, &opp->dynamic);
debugfs_create_bool("turbo", S_IRUGO, d, &opp->turbo);
debugfs_create_bool("suspend", S_IRUGO, d, &opp->suspend);
- debugfs_create_u32("performance_state", S_IRUGO, d, &opp->pstate);
debugfs_create_u32("level", S_IRUGO, d, &opp->level);
debugfs_create_ulong("clock_latency_ns", S_IRUGO, d,
&opp->clock_latency_ns);
+ if (opp_table->is_genpd)
+ debugfs_create_u32("performance_state", S_IRUGO, d, &opp->pstate);
+
opp->of_name = of_node_full_name(opp->np);
debugfs_create_str("of_name", S_IRUGO, d, (char **)&opp->of_name);