aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@free.fr>2011-03-26 22:05:58 +0100
committerAmit Kucheria <amit.kucheria@linaro.org>2011-04-04 02:24:34 +0300
commitfac6aea944d35abb83fe94afd7b087ac83e28015 (patch)
treea1bcea377c249cec0decbd12519e7f5e0df7af64
parent691d5569d54cbd42531d65f1fe1852d8ea3512bd (diff)
downloadpowerdebug-fac6aea944d35abb83fe94afd7b087ac83e28015.tar.gz
pass numregulators parameter to regulator_print_info
The regulator_print_info does no longer rely on the numregulators global variable. Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
-rw-r--r--powerdebug.c3
-rw-r--r--regulator.c6
-rw-r--r--regulator.h3
3 files changed, 7 insertions, 5 deletions
diff --git a/powerdebug.c b/powerdebug.c
index 7d91845..d310d5c 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -269,7 +269,8 @@ int mainloop(struct powerdebug_options *options)
show_regulator_info(regulators_info, options->verbose);
}
else
- regulator_print_info(regulators_info, options->verbose);
+ regulator_print_info(regulators_info, numregulators,
+ options->verbose);
}
if (options->clocks || options->selectedwindow == CLOCK) {
diff --git a/regulator.c b/regulator.c
index 0371961..93a03cf 100644
--- a/regulator.c
+++ b/regulator.c
@@ -53,14 +53,14 @@ static void print_string_val(char *name, char *val)
printf("\n");
}
-void regulator_print_info(struct regulator_info *reg_info, int verbose)
+void regulator_print_info(struct regulator_info *reg_info, int nr_reg, int verbose)
{
int i;
printf("\nRegulator Information:\n");
printf("*********************\n\n");
- for (i = 0; i < numregulators; i++) {
+ for (i = 0; i < nr_reg; i++) {
printf("Regulator %d:\n", i + 1);
print_string_val("name", reg_info[i].name);
if (strcmp(reg_info[i].status, ""))
@@ -105,7 +105,7 @@ void regulator_print_info(struct regulator_info *reg_info, int verbose)
printf("\n");
}
- if (!numregulators && verbose) {
+ if (!nr_reg && verbose) {
printf("Could not find regulator information!");
printf(" Looks like %s is empty.\n\n", SYSFS_REGULATOR);
}
diff --git a/regulator.h b/regulator.h
index 814691e..0c843b3 100644
--- a/regulator.h
+++ b/regulator.h
@@ -42,4 +42,5 @@ struct regulator_info {
extern struct regulator_info *regulator_init(int *nr_regulators);
extern int regulator_read_info(struct regulator_info *reg_info);
-extern void regulator_print_info(struct regulator_info *reg_info, int verbose);
+extern void regulator_print_info(struct regulator_info *reg_info,
+ int nr_reg, int verbose);