There's no need to add timecounter code inside of __HAVE_TIMECOUNTER

ifdefs.
This commit is contained in:
xtraeme 2007-08-26 17:15:42 +00:00
parent 8a8a9250de
commit 434a9a86ff
3 changed files with 5 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: amdpm.c,v 1.26 2007/07/09 21:00:52 ad Exp $ */
/* $NetBSD: amdpm.c,v 1.27 2007/08/26 17:17:06 xtraeme Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: amdpm.c,v 1.26 2007/07/09 21:00:52 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: amdpm.c,v 1.27 2007/08/26 17:17:06 xtraeme Exp $");
#include "opt_amdpm.h"
@ -48,10 +48,8 @@ __KERNEL_RCSID(0, "$NetBSD: amdpm.c,v 1.26 2007/07/09 21:00:52 ad Exp $");
#include <sys/callout.h>
#include <sys/rnd.h>
#ifdef __HAVE_TIMECOUNTER
#include <machine/bus.h>
#include <dev/ic/acpipmtimer.h>
#endif
#include <dev/i2c/i2cvar.h>
@ -159,14 +157,12 @@ amdpm_attach(struct device *parent, struct device *self, void *aux)
}
}
#ifdef __HAVE_TIMECOUNTER
/* don't attach a timecounter on nforce boards */
if ((confreg & AMDPM_TMRRST) == 0 && (confreg & AMDPM_STOPTMR) == 0 &&
!sc->sc_nforce) {
acpipmtimer_attach(&sc->sc_dev, sc->sc_iot, sc->sc_ioh,
AMDPM_TMR, ((confreg & AMDPM_TMR32) ? ACPIPMT_32BIT : 0));
}
#endif
/* try to attach devices on the smbus */
if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_PBC8111_ACPI ||

View File

@ -1,4 +1,4 @@
/* $NetBSD: piixpm.c,v 1.14 2007/08/06 22:41:22 martin Exp $ */
/* $NetBSD: piixpm.c,v 1.15 2007/08/26 17:17:06 xtraeme Exp $ */
/* $OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $ */
/*
@ -38,9 +38,7 @@
#include <dev/i2c/i2cvar.h>
#ifdef __HAVE_TIMECOUNTER
#include <dev/ic/acpipmtimer.h>
#endif
#ifdef PIIXPM_DEBUG
#define DPRINTF(x) printf x
@ -138,9 +136,7 @@ piixpm_attach(struct device *parent, struct device *self, void *aux)
struct pci_attach_args *pa = aux;
struct i2cbus_attach_args iba;
pcireg_t base, conf;
#ifdef __HAVE_TIMECOUNTER
pcireg_t pmmisc;
#endif
pci_intr_handle_t ih;
char devinfo[256];
const char *intrstr = NULL;
@ -164,7 +160,6 @@ piixpm_attach(struct device *parent, struct device *self, void *aux)
conf = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_HOSTC);
DPRINTF((": conf 0x%x", conf));
#ifdef __HAVE_TIMECOUNTER
if ((PCI_VENDOR(pa->pa_id) != PCI_VENDOR_INTEL) ||
(PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_INTEL_82371AB_PMC))
goto nopowermanagement;
@ -194,8 +189,6 @@ piixpm_attach(struct device *parent, struct device *self, void *aux)
(PCI_REVISION(pa->pa_class) < 3) ? ACPIPMT_BADLATCH : 0 );
nopowermanagement:
#endif
if ((conf & PIIX_SMB_HOSTC_HSTEN) == 0) {
aprint_normal("%s: SMBus disabled\n", sc->sc_dev.dv_xname);
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: viaenv.c,v 1.22 2007/07/01 22:20:34 xtraeme Exp $ */
/* $NetBSD: viaenv.c,v 1.23 2007/08/26 17:15:42 xtraeme Exp $ */
/*
* Copyright (c) 2000 Johan Danielsson
@ -38,17 +38,15 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: viaenv.c,v 1.22 2007/07/01 22:20:34 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: viaenv.c,v 1.23 2007/08/26 17:15:42 xtraeme Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>
#ifdef __HAVE_TIMECOUNTER
#include <machine/bus.h>
#include <dev/ic/acpipmtimer.h>
#endif
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
@ -368,7 +366,6 @@ viaenv_attach(struct device *parent, struct device *self, void *aux)
sc->sc_dev.dv_xname);
nohwm:
#ifdef __HAVE_TIMECOUNTER
/* Check if power management I/O space is enabled */
control = pci_conf_read(pa->pa_pc, pa->pa_tag, VIAENV_GENCFG);
if ((control & VIAENV_GENCFG_PMEN) == 0) {
@ -392,7 +389,6 @@ nohwm:
((control & VIAENV_GENCFG_TMR32) ? ACPIPMT_32BIT : 0));
nopm:
#endif /* __HAVE_TIMECOUNTER */
return;
}