summaryrefslogtreecommitdiff
path: root/sys/dev/extres
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2018-04-20 20:30:33 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2018-04-20 20:30:33 +0000
commitbfeb2bd7cab178be6d098455e5c4b24dd3c00ee3 (patch)
tree31d3968b3b767dea87079a85448304eec7cf7ebd /sys/dev/extres
parentc712135a32a8b20ef47c35950b6b521358b455d8 (diff)
Notes
Diffstat (limited to 'sys/dev/extres')
-rw-r--r--sys/dev/extres/regulator/regulator.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/extres/regulator/regulator.c b/sys/dev/extres/regulator/regulator.c
index 535665fcd1ec..7cebf27aee6f 100644
--- a/sys/dev/extres/regulator/regulator.c
+++ b/sys/dev/extres/regulator/regulator.c
@@ -166,17 +166,19 @@ static void
regulator_shutdown(void *dummy)
{
struct regnode *entry;
+ int status, ret;
int disable = 1;
REG_TOPO_SLOCK();
TUNABLE_INT_FETCH("hw.regulator.disable_unused", &disable);
TAILQ_FOREACH(entry, &regnode_list, reglist_link) {
- if (entry->enable_cnt == 0 &&
- entry->std_param.always_on == 0 && disable) {
+ if (entry->std_param.always_on == 0 && disable) {
if (bootverbose)
printf("regulator: shuting down %s\n",
entry->name);
- regnode_stop(entry, 0);
+ ret = regnode_status(entry, &status);
+ if (ret == 0 && status == REGULATOR_STATUS_ENABLED)
+ regnode_stop(entry, 0);
}
}
REG_TOPO_UNLOCK();