aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);