power: Add PROFILE_MAX to enum

Change-Id: If7349c98598d346f5b03b32dceb5f797c8b02ce7
This commit is contained in:
Christopher N. Hesse 2017-01-17 00:01:15 +01:00
parent d928574407
commit 58f2ca07ed

View file

@ -57,7 +57,8 @@ struct samsung_power_module {
enum power_profile_e { enum power_profile_e {
PROFILE_POWER_SAVE = 0, PROFILE_POWER_SAVE = 0,
PROFILE_BALANCED, PROFILE_BALANCED,
PROFILE_HIGH_PERFORMANCE PROFILE_HIGH_PERFORMANCE,
PROFILE_MAX
}; };
static enum power_profile_e current_power_profile = PROFILE_BALANCED; static enum power_profile_e current_power_profile = PROFILE_BALANCED;
@ -141,11 +142,15 @@ static int boostpulse_open(struct samsung_power_module *samsung_pwr)
} }
static void set_power_profile(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; int rc;
struct stat sb; struct stat sb;
if (profile < 0 || profile >= PROFILE_MAX) {
return;
}
if (current_power_profile == profile) { if (current_power_profile == profile) {
return; return;
} }
@ -404,7 +409,7 @@ static int samsung_get_feature(struct power_module *module __unused,
feature_t feature) feature_t feature)
{ {
if (feature == POWER_FEATURE_SUPPORTED_PROFILES) { if (feature == POWER_FEATURE_SUPPORTED_PROFILES) {
return 3; return PROFILE_MAX;
} }
return -1; return -1;