True, but it's the best we've got for this kind of thing.
Globals ... yeech.
My general belief is that there should be a set of predicates
that drivers use to test whether or not the target system state
satisfies various prerequisites. Like whether a clock or power
domain must be disabled, and so on.
In this specific case, a system_is_powering_down() predicate is
the logical application of that policy to this problem.
- Dave
--