Skip to content

Commit 1beaf76

Browse files
Krystian Garbaciakbroonie
authored andcommitted
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 <krystian.garbaciak@diasemi.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
1 parent 03ffcf3 commit 1beaf76

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎drivers/regulator/core.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ static ssize_t regulator_status_show(struct device *dev,
393393
case REGULATOR_STATUS_STANDBY:
394394
label = "standby";
395395
break;
396+
case REGULATOR_STATUS_UNDEFINED:
397+
label = "undefined";
398+
break;
396399
default:
397400
return -ERANGE;
398401
}
@@ -2897,7 +2900,7 @@ int regulator_mode_to_status(unsigned int mode)
28972900
case REGULATOR_MODE_STANDBY:
28982901
return REGULATOR_STATUS_STANDBY;
28992902
default:
2900-
return 0;
2903+
return REGULATOR_STATUS_UNDEFINED;
29012904
}
29022905
}
29032906
EXPORT_SYMBOL_GPL(regulator_mode_to_status);

‎include/linux/regulator/driver.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ enum regulator_status {
3232
REGULATOR_STATUS_NORMAL,
3333
REGULATOR_STATUS_IDLE,
3434
REGULATOR_STATUS_STANDBY,
35+
/* in case that any other status doesn't apply */
36+
REGULATOR_STATUS_UNDEFINED,
3537
};
3638

3739
/**

0 commit comments

Comments
 (0)