macintosh/via-pmu: Enhance state machine with new 'uninitialized' state
authorFinn Thain <fthain@telegraphics.com.au>
Mon, 2 Jul 2018 08:21:18 +0000 (04:21 -0400)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 31 Jul 2018 09:56:40 +0000 (19:56 +1000)
commitc57902d52e2d61299872ddc89645d3aa299f1b91
tree2ee789150109b1c10726a4ef36b8aee63ea95cf7
parent7ad94699a94b388780e40158e6954a22b68e9d20
macintosh/via-pmu: Enhance state machine with new 'uninitialized' state

On 68k Macs, the via/vias pointer can't be used to determine whether
the PMU driver has been initialized. For portability, add a new state
to indicate that via_find_pmu() succeeded.

After via_find_pmu() executes, testing vias == NULL is equivalent to
testing via == NULL. Replace these tests with pmu_state == uninitialized
which is simpler and more consistent. No functional change.

Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/macintosh/via-pmu.c