]> git.karo-electronics.de Git - linux-beck.git/commitdiff
regulator: Add REGULATOR_STATUS_UNDEFINED.
authorKrystian Garbaciak <krystian.garbaciak@diasemi.com>
Thu, 12 Jul 2012 12:53:35 +0000 (13:53 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 12 Jul 2012 17:19:24 +0000 (18:19 +0100)
REGULATOR_STATUS_UNDEFINED is to be returned by regulator, if any other state
doesn't really apply.

Signed-off-by: Krystian Garbaciak <krystian.garbaciak@diasemi.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/core.c
include/linux/regulator/driver.h

index 4b136f8cb99fc2e555db41530887ee5d1a2f9e94..01a67c50c4eaeb3c71290736d308ac2909166f62 100644 (file)
@@ -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);
index 80226383e561d1ceb536235f52040a0414c5bc7f..2513a54ca2e813014a9ae83fc75012d9e0a8cfd1 100644 (file)
@@ -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,
 };
 
 /**