summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Shields <keepcalm444@gmail.com>2016-12-16 21:25:25 -0600
committer5x <droidfivex@gmail.com>2017-02-07 10:30:08 +0900
commit560b9df58962749d6bae43fe89d08ff07d674fb9 (patch)
tree381ef48585bdc4aaa71d829e9b792e30388915a2
parent8c7cb291842e67fcfa4d002a7924c2437456cd37 (diff)
hammerhead: powerhal: dereference data pointer
Solves the issue of being stuck in low_power_mode after disabling battery save mode. Change-Id: Ie96d44e564679b11aa122fadb34f6d1ac21a5700
-rw-r--r--power/power_hammerhead.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/power/power_hammerhead.c b/power/power_hammerhead.c
index 662ea49..4da41bc 100644
--- a/power/power_hammerhead.c
+++ b/power/power_hammerhead.c
@@ -339,7 +339,7 @@ static void power_set_interactive(__attribute__((unused)) struct power_module *m
}
static void power_hint( __attribute__((unused)) struct power_module *module,
- power_hint_t hint, __attribute__((unused)) void *data)
+ power_hint_t hint, void *data)
{
int cpu, ret;
@@ -350,7 +350,7 @@ static void power_hint( __attribute__((unused)) struct power_module *module,
break;
#if 0
case POWER_HINT_VSYNC:
- ALOGV("POWER_HINT_VSYNC %s", (data ? "ON" : "OFF"));
+ ALOGV("POWER_HINT_VSYNC %s", ((*(int32_t *)data) ? "ON" : "OFF"));
break;
#endif
case POWER_HINT_VIDEO_ENCODE:
@@ -359,7 +359,7 @@ static void power_hint( __attribute__((unused)) struct power_module *module,
case POWER_HINT_LOW_POWER:
pthread_mutex_lock(&low_power_mode_lock);
- if (data) {
+ if (*(int32_t *)data) {
low_power_mode = true;
for (cpu = 0; cpu < TOTAL_CPUS; cpu++) {
sysfs_write(cpu_path_min[cpu], LOW_POWER_MIN_FREQ);