From: Krystian Garbaciak Date: Thu, 12 Jul 2012 12:53:35 +0000 (+0100) Subject: regulator: Add REGULATOR_STATUS_UNDEFINED. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1beaf762b4ad5f53876f790bb6cfbd3bac072985;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git regulator: Add REGULATOR_STATUS_UNDEFINED. REGULATOR_STATUS_UNDEFINED is to be returned by regulator, if any other state doesn't really apply. Signed-off-by: Krystian Garbaciak Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 4b136f8cb99..01a67c50c4e 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -393,6 +393,9 @@ static ssize_t regulator_status_show(struct device *dev, case REGULATOR_STATUS_STANDBY: label = "standby"; break; + case REGULATOR_STATUS_UNDEFINED: + label = "undefined"; + break; default: return -ERANGE; } @@ -2897,7 +2900,7 @@ int regulator_mode_to_status(unsigned int mode) case REGULATOR_MODE_STANDBY: return REGULATOR_STATUS_STANDBY; default: - return 0; + return REGULATOR_STATUS_UNDEFINED; } } EXPORT_SYMBOL_GPL(regulator_mode_to_status); diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 80226383e56..2513a54ca2e 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -32,6 +32,8 @@ enum regulator_status { REGULATOR_STATUS_NORMAL, REGULATOR_STATUS_IDLE, REGULATOR_STATUS_STANDBY, + /* in case that any other status doesn't apply */ + REGULATOR_STATUS_UNDEFINED, }; /**