From 1d83a2dea6dcc0f9d62ccd16bc7ac65fcbd73bd3 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Mon, 25 Sep 2006 23:11:07 +0000 Subject: [PATCH] No need to call pci_set_powerstate from our powerhook, the bus handles this for us now. --- sys/dev/pci/auich.c | 19 ++----------------- sys/dev/pci/esa.c | 13 ++----------- sys/dev/pci/esm.c | 10 ++-------- 3 files changed, 6 insertions(+), 36 deletions(-) diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c index 4a4a584f721a..d923eba3f42b 100644 --- a/sys/dev/pci/auich.c +++ b/sys/dev/pci/auich.c @@ -1,4 +1,4 @@ -/* $NetBSD: auich.c,v 1.112 2006/09/24 03:53:09 jmcneill Exp $ */ +/* $NetBSD: auich.c,v 1.113 2006/09/25 23:11:07 jmcneill Exp $ */ /*- * Copyright (c) 2000, 2004, 2005 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.112 2006/09/24 03:53:09 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: auich.c,v 1.113 2006/09/25 23:11:07 jmcneill Exp $"); #include #include @@ -1614,7 +1614,6 @@ static void auich_powerhook(int why, void *addr) { struct auich_softc *sc; - int rv; sc = (struct auich_softc *)addr; switch (why) { @@ -1635,15 +1634,6 @@ auich_powerhook(int why, void *addr) if (sc->sc_ih != NULL) pci_intr_disestablish(sc->sc_pc, sc->sc_ih); - rv = pci_get_powerstate(sc->sc_pc, sc->sc_pt, &sc->sc_powerstate); - if (rv) - aprint_error("%s: unable to get power state (err=%d)\n", - sc->sc_dev.dv_xname, rv); - rv = pci_set_powerstate(sc->sc_pc, sc->sc_pt, PCI_PMCSR_STATE_D3); - if (rv) - aprint_error("%s: unable to set power state (err=%d)\n", - sc->sc_dev.dv_xname, rv); - break; case PWR_RESUME: @@ -1656,11 +1646,6 @@ auich_powerhook(int why, void *addr) return; } - rv = pci_set_powerstate(sc->sc_pc, sc->sc_pt, sc->sc_powerstate); - if (rv) - aprint_error("%s: unable to set power state (err=%d)\n", - sc->sc_dev.dv_xname, rv); - sc->sc_ih = pci_intr_establish(sc->sc_pc, sc->intrh, IPL_AUDIO, auich_intr, sc); if (sc->sc_ih == NULL) { diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c index 186569afd31e..d1aecdddbda4 100644 --- a/sys/dev/pci/esa.c +++ b/sys/dev/pci/esa.c @@ -1,4 +1,4 @@ -/* $NetBSD: esa.c,v 1.37 2006/09/24 14:26:50 jmcneill Exp $ */ +/* $NetBSD: esa.c,v 1.38 2006/09/25 23:19:39 jmcneill Exp $ */ /* * Copyright (c) 2001, 2002, 2006 Jared D. McNeill @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.37 2006/09/24 14:26:50 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.38 2006/09/25 23:19:39 jmcneill Exp $"); #include #include @@ -1662,7 +1662,6 @@ esa_suspend(struct esa_softc *sc) bus_space_tag_t iot; bus_space_handle_t ioh; int i, index; - int error; iot = sc->sc_iot; ioh = sc->sc_ioh; @@ -1683,10 +1682,6 @@ esa_suspend(struct esa_softc *sc) sc->savemem[index++] = esa_read_assp(sc, ESA_MEMTYPE_INTERNAL_DATA, i); - if ((error = pci_set_powerstate(sc->sc_pct, sc->sc_tag, - PCI_PMCSR_STATE_D3))) - return error; - return 0; } @@ -1697,15 +1692,11 @@ esa_resume(struct esa_softc *sc) bus_space_handle_t ioh; int i, index; uint8_t reset_state; - int error; iot = sc->sc_iot; ioh = sc->sc_ioh; index = 0; - if ((error = pci_set_powerstate(sc->sc_pct, sc->sc_tag, - PCI_PMCSR_STATE_D0))) - return error; delay(10000); esa_config(sc); diff --git a/sys/dev/pci/esm.c b/sys/dev/pci/esm.c index 0cd88420ddfb..cb5ed0d30865 100644 --- a/sys/dev/pci/esm.c +++ b/sys/dev/pci/esm.c @@ -1,4 +1,4 @@ -/* $NetBSD: esm.c,v 1.38 2006/09/24 13:24:32 jmcneill Exp $ */ +/* $NetBSD: esm.c,v 1.39 2006/09/25 23:20:33 jmcneill Exp $ */ /*- * Copyright (c) 2002, 2003 Matt Fredette @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: esm.c,v 1.38 2006/09/24 13:24:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: esm.c,v 1.39 2006/09/25 23:20:33 jmcneill Exp $"); #include #include @@ -1733,7 +1733,6 @@ int esm_suspend(struct esm_softc *ess) { int x; - int error; x = splaudio(); wp_stoptimer(ess); @@ -1748,8 +1747,6 @@ esm_suspend(struct esm_softc *ess) delay(20); bus_space_write_4(ess->st, ess->sh, PORT_RINGBUS_CTRL, 0); delay(1); - if ((error = pci_set_powerstate(ess->pc, ess->tag, PCI_PMCSR_STATE_D3))) - return error; return 0; } @@ -1758,11 +1755,8 @@ int esm_resume(struct esm_softc *ess) { int x; - int error; uint16_t pcmbar; - if ((error = pci_set_powerstate(ess->pc, ess->tag, PCI_PMCSR_STATE_D0))) - return error; delay(100000); esm_init(ess);