diff options
author | John-Mark Gurney <jmg@FreeBSD.org> | 2005-04-01 16:22:50 +0000 |
---|---|---|
committer | John-Mark Gurney <jmg@FreeBSD.org> | 2005-04-01 16:22:50 +0000 |
commit | 5da5a253a59d83aa35c3da9619af16a97cf9cb4c (patch) | |
tree | f02f1987b696e4580532f8288ee2ac2eb31c7e30 | |
parent | 4bc60ea3fb1fbac5bda794a54ce6b96a49f0c934 (diff) | |
download | src-5da5a253a59d83aa35c3da9619af16a97cf9cb4c.tar.gz src-5da5a253a59d83aa35c3da9619af16a97cf9cb4c.zip |
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...
Notes
Notes:
svn path=/head/; revision=144492
-rw-r--r-- | sys/dev/pci/pci.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index ceb0c752d476..e24b3b1651b0 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -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); |