lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <2714dc5997438adb20f5ac8f2a39823562ed2e55.1497365288.git.mirq-linux@rere.qmqm.pl>
Date:   Tue, 13 Jun 2017 16:50:35 +0200
From:   Michał Mirosław <mirq-linux@...e.qmqm.pl>
To:     linux-kernel@...r.kernel.org
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>
Subject: [PATCH v2 1/2] regulator: include 'enabled' status in
 debugfs/regulator_summary

Extend regulator's info line with enabled/disabled status.

Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
---
v2:
  - include commit message

 drivers/regulator/core.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c0d9ae8d0860e..ba4d121ae07fc 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4379,13 +4379,18 @@ static void regulator_summary_show_subtree(struct seq_file *s,
 	struct regulation_constraints *c;
 	struct regulator *consumer;
 	struct summary_data summary_data;
+	int is_enabled;
 
 	if (!rdev)
 		return;
 
-	seq_printf(s, "%*s%-*s %3d %4d %6d ",
+	mutex_lock(&rdev->mutex);
+	is_enabled = _regulator_is_enabled(rdev);
+	mutex_unlock(&rdev->mutex);
+
+	seq_printf(s, "%*s%-*s %3d %3d %4d %6d ",
 		   level * 3 + 1, "",
-		   30 - level * 3, rdev_get_name(rdev),
+		   30 - level * 3, rdev_get_name(rdev), is_enabled,
 		   rdev->use_count, rdev->open_count, rdev->bypass_count);
 
 	seq_printf(s, "%5dmV ", _regulator_get_voltage(rdev) / 1000);
@@ -4450,8 +4455,8 @@ static int regulator_summary_show_roots(struct device *dev, void *data)
 
 static int regulator_summary_show(struct seq_file *s, void *data)
 {
-	seq_puts(s, " regulator                      use open bypass voltage current     min     max\n");
-	seq_puts(s, "-------------------------------------------------------------------------------\n");
+	seq_puts(s, " regulator                      ena use open bypass voltage current     min     max\n");
+	seq_puts(s, "-----------------------------------------------------------------------------------\n");
 
 	class_for_each_device(&regulator_class, NULL, s,
 			      regulator_summary_show_roots);
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ