diff options
Diffstat (limited to 'arch/arm/mach-omap2/powerdomain.c')
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 5164d587ef52..8a18d1bd61c8 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -1002,16 +1002,16 @@ int pwrdm_post_transition(void) | |||
1002 | * @pwrdm: struct powerdomain * to wait for | 1002 | * @pwrdm: struct powerdomain * to wait for |
1003 | * | 1003 | * |
1004 | * Context loss count is the sum of powerdomain off-mode counter, the | 1004 | * Context loss count is the sum of powerdomain off-mode counter, the |
1005 | * logic off counter and the per-bank memory off counter. Returns 0 | 1005 | * logic off counter and the per-bank memory off counter. Returns negative |
1006 | * (and WARNs) upon error, otherwise, returns the context loss count. | 1006 | * (and WARNs) upon error, otherwise, returns the context loss count. |
1007 | */ | 1007 | */ |
1008 | u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm) | 1008 | int pwrdm_get_context_loss_count(struct powerdomain *pwrdm) |
1009 | { | 1009 | { |
1010 | int i, count; | 1010 | int i, count; |
1011 | 1011 | ||
1012 | if (!pwrdm) { | 1012 | if (!pwrdm) { |
1013 | WARN(1, "powerdomain: %s: pwrdm is null\n", __func__); | 1013 | WARN(1, "powerdomain: %s: pwrdm is null\n", __func__); |
1014 | return 0; | 1014 | return -ENODEV; |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | count = pwrdm->state_counter[PWRDM_POWER_OFF]; | 1017 | count = pwrdm->state_counter[PWRDM_POWER_OFF]; |
@@ -1020,7 +1020,13 @@ u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm) | |||
1020 | for (i = 0; i < pwrdm->banks; i++) | 1020 | for (i = 0; i < pwrdm->banks; i++) |
1021 | count += pwrdm->ret_mem_off_counter[i]; | 1021 | count += pwrdm->ret_mem_off_counter[i]; |
1022 | 1022 | ||
1023 | pr_debug("powerdomain: %s: context loss count = %u\n", | 1023 | /* |
1024 | * Context loss count has to be a non-negative value. Clear the sign | ||
1025 | * bit to get a value range from 0 to INT_MAX. | ||
1026 | */ | ||
1027 | count &= INT_MAX; | ||
1028 | |||
1029 | pr_debug("powerdomain: %s: context loss count = %d\n", | ||
1024 | pwrdm->name, count); | 1030 | pwrdm->name, count); |
1025 | 1031 | ||
1026 | return count; | 1032 | return count; |