[powerdebug 16/35] split dump and display

Daniel Lezcano daniel.lezcano at free.fr
Sat Mar 26 21:06:04 UTC 2011


Let's create a specific function to dump instead of managing with ncurses

Signed-off-by: Daniel Lezcano <daniel.lezcano at free.fr>Index: powerdebug/powerdebug.c
===================================================================
---
 powerdebug.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/powerdebug.c b/powerdebug.c
index 7eb9c5e..bb024fc 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -341,6 +341,12 @@ int mainloop(struct powerdebug_options *options,
 	return 0;
 }
 
+static int powerdebug_dump(struct powerdebug_options *options,
+			   struct regulator_info *reg_info, int nr_reg)
+{
+	return 0;
+}
+
 int main(int argc, char **argv)
 {
 	struct powerdebug_options *options;
@@ -364,6 +370,13 @@ int main(int argc, char **argv)
 		return 1;
 	}
 
+	/* we just dump the informations */
+	if (options->dump) {
+		if (powerdebug_dump(options, regulators_info, numregulators))
+			return 1;
+		return 0;
+	}
+
 	if (mainloop(options, regulators_info, numregulators))
 		return 1;
 
-- 
1.7.1




More information about the linaro-dev mailing list