]> git.baikalelectronics.ru Git - kernel.git/commitdiff
OMAP powerdomain/PM: use symbolic constants for the max number of power states
authorPaul Walmsley <paul@pwsan.com>
Tue, 8 Dec 2009 23:33:12 +0000 (16:33 -0700)
committerpaul <paul@twilight.(none)>
Sat, 12 Dec 2009 00:00:41 +0000 (17:00 -0700)
Replace some bare constants with power states.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-omap2/pm-debug.c
arch/arm/mach-omap2/powerdomain.c
arch/arm/plat-omap/include/plat/powerdomain.h

index 8baa30d2acfbf2dd79a464ecda5c935b457e96b6..860b755d222074ce1bb061510f3a16fbc2cafa5b 100644 (file)
@@ -326,7 +326,7 @@ int pm_dbg_regset_save(int reg_set)
        return 0;
 }
 
-static const char pwrdm_state_names[][4] = {
+static const char pwrdm_state_names[][PWRDM_MAX_PWRSTS] = {
        "OFF",
        "RET",
        "INA",
@@ -381,7 +381,7 @@ static int pwrdm_dbg_show_counter(struct powerdomain *pwrdm, void *user)
 
        seq_printf(s, "%s (%s)", pwrdm->name,
                        pwrdm_state_names[pwrdm->state]);
-       for (i = 0; i < 4; i++)
+       for (i = 0; i < PWRDM_MAX_PWRSTS; i++)
                seq_printf(s, ",%s:%d", pwrdm_state_names[i],
                        pwrdm->state_counter[i]);
 
index 41472670e4b4f461c4aa72861012eb61e811dfac..1dd1a3817e8b00fa584a622a1a17af60226bc23a 100644 (file)
@@ -158,7 +158,7 @@ static __init void _pwrdm_setup(struct powerdomain *pwrdm)
 {
        int i;
 
-       for (i = 0; i < 4; i++)
+       for (i = 0; i < PWRDM_MAX_PWRSTS; i++)
                pwrdm->state_counter[i] = 0;
 
        pwrdm_wait_transition(pwrdm);
index 3d45ee1d3cf49fad790459ca16aff0021f1b02d9..5a80ddb4bb7e66fb96911ae25897af6f343eb921 100644 (file)
@@ -28,6 +28,8 @@
 #define PWRDM_POWER_INACTIVE   0x2
 #define PWRDM_POWER_ON         0x3
 
+#define PWRDM_MAX_PWRSTS       4
+
 /* Powerdomain allowable state bitfields */
 #define PWRSTS_OFF_ON          ((1 << PWRDM_POWER_OFF) | \
                                 (1 << PWRDM_POWER_ON))
@@ -118,11 +120,11 @@ struct powerdomain {
        struct list_head node;
 
        int state;
-       unsigned state_counter[4];
+       unsigned state_counter[PWRDM_MAX_PWRSTS];
 
 #ifdef CONFIG_PM_DEBUG
        s64 timer;
-       s64 state_timer[4];
+       s64 state_timer[PWRDM_MAX_PWRSTS];
 #endif
 };