]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
regulator: Check status before disabling
authorEmmanuel Vadot <manu@FreeBSD.org>
Fri, 20 Apr 2018 20:30:33 +0000 (20:30 +0000)
committerEmmanuel Vadot <manu@FreeBSD.org>
Fri, 20 Apr 2018 20:30:33 +0000 (20:30 +0000)
commitbfeb2bd7cab178be6d098455e5c4b24dd3c00ee3
tree31d3968b3b767dea87079a85448304eec7cf7ebd
parentc712135a32a8b20ef47c35950b6b521358b455d8
regulator: Check status before disabling

When disabling regulator when they are unused, check before is they are
enabled.
While here don't check the enable_cnt on the regulator entry as it is
checked by regnode_stop.
This solve the panic on any board using a fixed regulator that is driven
by a gpio when the regulator is unused.

Tested On: OrangePi One
Pointy Hat to:     myself
Reported by: kevans, Milan Obuch (freebsd-arm@dino.sk)
sys/dev/extres/regulator/regulator.c