Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci psc_pwrmgmt_csr_reg was never initialized to the...



details:   https://anonhg.NetBSD.org/src/rev/ced3514417a1
branches:  trunk
changeset: 753302:ced3514417a1
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Mon Mar 22 17:20:42 2010 +0000

description:
psc_pwrmgmt_csr_reg was never initialized to the actual offset of the
PCI PMCSR!  Just delete psc_pwrmgmt_csr_reg and all uses of it.  In this
way, ex_pci_disable() becomes a no-op, so delete it, too.

diffstat:

 sys/dev/pci/if_ex_pci.c |  27 +++------------------------
 1 files changed, 3 insertions(+), 24 deletions(-)

diffs (71 lines):

diff -r 48e9e778db21 -r ced3514417a1 sys/dev/pci/if_ex_pci.c
--- a/sys/dev/pci/if_ex_pci.c   Mon Mar 22 17:12:09 2010 +0000
+++ b/sys/dev/pci/if_ex_pci.c   Mon Mar 22 17:20:42 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ex_pci.c,v 1.51 2010/02/26 00:38:14 dyoung Exp $    */
+/*     $NetBSD: if_ex_pci.c,v 1.52 2010/03/22 17:20:42 dyoung Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ex_pci.c,v 1.51 2010/02/26 00:38:14 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ex_pci.c,v 1.52 2010/03/22 17:20:42 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,9 +74,6 @@
        pci_chipset_tag_t psc_pc;       /* pci chipset tag */
        pcireg_t psc_regs[0x40>>2];     /* saved PCI config regs (sparse) */
        pcitag_t psc_tag;               /* pci device tag */
-
-       int psc_pwrmgmt_csr_reg;        /* ACPI power management register */
-       pcireg_t psc_pwrmgmt_csr;       /* ...and the contents at D0 */
 };
 
 /*
@@ -96,7 +93,6 @@
 static void    ex_pci_intr_ack(struct ex_softc *);
 
 static int     ex_pci_enable(struct ex_softc *);
-static void    ex_pci_disable(struct ex_softc *);
 
 static void    ex_pci_confreg_restore(struct ex_pci_softc *);
 static int     ex_d3tod0(pci_chipset_tag_t, pcitag_t, device_t, pcireg_t);
@@ -277,7 +273,7 @@
                break;
        case 0: 
                sc->enable = ex_pci_enable;
-               sc->disable = ex_pci_disable;
+               sc->disable = NULL;
                break;
        default:
                aprint_error_dev(self, "cannot activate %d\n", error);
@@ -390,25 +386,8 @@
 
        aprint_debug_dev(sc->sc_dev, "going to power state D0\n");
 
-       /* Bring the device into D0 power state. */
-       pci_conf_write(psc->psc_pc, psc->psc_tag,
-           psc->psc_pwrmgmt_csr_reg, psc->psc_pwrmgmt_csr);
-
        /* Now restore the configuration registers. */
        ex_pci_confreg_restore(psc);
 
        return (0);
 }
-
-static void
-ex_pci_disable(struct ex_softc *sc)
-{
-       struct ex_pci_softc *psc = (void *) sc;
-
-       aprint_debug_dev(sc->sc_dev, "going to power state D3\n");
-
-       /* Put the device into D3 state. */
-       pci_conf_write(psc->psc_pc, psc->psc_tag,
-           psc->psc_pwrmgmt_csr_reg, (psc->psc_pwrmgmt_csr &
-           ~PCI_PMCSR_STATE_MASK) | PCI_PMCSR_STATE_D3);
-}



Home | Main Index | Thread Index | Old Index