aboutsummaryrefslogtreecommitdiff
path: root/powerdebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'powerdebug.c')
-rw-r--r--powerdebug.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/powerdebug.c b/powerdebug.c
index 0f5c98a..b626b05 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -33,17 +33,6 @@
extern void sigwinch_handler(int);
-#define REGULATOR_OPTION 0x01
-#define SENSOR_OPTION 0x02
-#define CLOCK_OPTION 0x04
-#define GPIO_OPTION 0x08
-
-#define VERBOSE_OPTION 0x10
-#define DUMP_OPTION 0x20
-
-#define DEFAULT_OPTION (REGULATOR_OPTION | SENSOR_OPTION | \
- CLOCK_OPTION | GPIO_OPTION)
-
void usage(void)
{
printf("Usage: powerdebug [OPTIONS]\n");
@@ -243,22 +232,22 @@ int main(int argc, char **argv)
return 1;
}
- if ((options->flags & REGULATOR_OPTION) && regulator_init()) {
+ if (regulator_init(options)) {
printf("failed to initialize regulator\n");
options->flags &= ~REGULATOR_OPTION;
}
- if ((options->flags & CLOCK_OPTION) && clock_init()) {
+ if (clock_init(options)) {
printf("failed to initialize clock details (check debugfs)\n");
options->flags &= ~CLOCK_OPTION;
}
- if ((options->flags & SENSOR_OPTION) && sensor_init()) {
+ if (sensor_init(options)) {
printf("failed to initialize sensors\n");
options->flags &= SENSOR_OPTION;
}
- if ((options->flags & GPIO_OPTION) && gpio_init()) {
+ if (gpio_init(options)) {
printf("failed to initialize gpios\n");
options->flags &= GPIO_OPTION;
}