move the statement about switching power states to just before we do it, so

we don't print a false statement if the destination powerstate is
unsupported...
This commit is contained in:
John-Mark Gurney 2005-04-01 16:22:50 +00:00
parent 4bc60ea3fb
commit 5da5a253a5

View File

@ -509,11 +509,6 @@ pci_set_powerstate_method(device_t dev, device_t child, int state)
if (oldstate == state)
return (0);
if (bootverbose)
printf(
"pci%d:%d:%d: Transition from D%d to D%d\n",
dinfo->cfg.bus, dinfo->cfg.slot, dinfo->cfg.func,
oldstate, state);
/*
* The PCI power management specification states that after a state
* transition between PCI power states, system software must
@ -556,6 +551,13 @@ pci_set_powerstate_method(device_t dev, device_t child, int state)
default:
return (EINVAL);
}
if (bootverbose)
printf(
"pci%d:%d:%d: Transition from D%d to D%d\n",
dinfo->cfg.bus, dinfo->cfg.slot, dinfo->cfg.func,
oldstate, state);
PCI_WRITE_CONFIG(dev, child, cfg->pp.pp_status, status, 2);
if (delay)
DELAY(delay);