summaryrefslogtreecommitdiffstats
path: root/power
diff options
context:
space:
mode:
authorChristopher N. Hesse <raymanfx@gmail.com>2017-01-17 00:01:15 +0100
committerChristopher N. Hesse <raymanfx@gmail.com>2017-01-30 22:07:59 +0000
commitc1f8a09738131cc9360337898d908395606f95e8 (patch)
treeb6870b1c797db99002319926cfa0a4fb09fe2fba /power
parentb1a506a4f2ed569593f7d1c8c42c79c9d8705f3c (diff)
downloadandroid_hardware_samsung-c1f8a09738131cc9360337898d908395606f95e8.tar.gz
android_hardware_samsung-c1f8a09738131cc9360337898d908395606f95e8.tar.bz2
android_hardware_samsung-c1f8a09738131cc9360337898d908395606f95e8.zip
power: Add PROFILE_MAX to enum
Change-Id: If7349c98598d346f5b03b32dceb5f797c8b02ce7
Diffstat (limited to 'power')
-rw-r--r--power/power.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/power/power.c b/power/power.c
index ea7be5a..e22d796 100644
--- a/power/power.c
+++ b/power/power.c
@@ -56,7 +56,8 @@ struct samsung_power_module {
enum power_profile_e {
PROFILE_POWER_SAVE = 0,
PROFILE_BALANCED,
- PROFILE_HIGH_PERFORMANCE
+ PROFILE_HIGH_PERFORMANCE,
+ PROFILE_MAX
};
static enum power_profile_e current_power_profile = PROFILE_BALANCED;
@@ -142,11 +143,15 @@ static int boostpulse_open(struct samsung_power_module *samsung_pwr)
}
static void set_power_profile(struct samsung_power_module *samsung_pwr,
- enum power_profile_e profile)
+ int profile)
{
int rc;
struct stat sb;
+ if (profile < 0 || profile >= PROFILE_MAX) {
+ return;
+ }
+
if (current_power_profile == profile) {
return;
}
@@ -406,7 +411,7 @@ static int samsung_get_feature(struct power_module *module __unused,
feature_t feature)
{
if (feature == POWER_FEATURE_SUPPORTED_PROFILES) {
- return 3;
+ return PROFILE_MAX;
}
return -1;