summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2010-08-27 15:41:42 +0000
committerderaadt <deraadt@openbsd.org>2010-08-27 15:41:42 +0000
commit2c6678e47bca79bbefefdbb62fbdbca52110a2ab (patch)
treece9ac50124cbde1254f3d3cad58b9883f8609dac /sys/dev/pci
parentno need for a sc_suspended variable (diff)
downloadwireguard-openbsd-2c6678e47bca79bbefefdbb62fbdbca52110a2ab.tar.xz
wireguard-openbsd-2c6678e47bca79bbefefdbb62fbdbca52110a2ab.zip
Improve sdhc_activate, and make sdhc_powerhook a simple wrapper around
it for now ok kettenis
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/sdhc_pci.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/sys/dev/pci/sdhc_pci.c b/sys/dev/pci/sdhc_pci.c
index 1c290a3741a..c9bd33d6446 100644
--- a/sys/dev/pci/sdhc_pci.c
+++ b/sys/dev/pci/sdhc_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc_pci.c,v 1.8 2010/07/01 18:08:17 deraadt Exp $ */
+/* $OpenBSD: sdhc_pci.c,v 1.9 2010/08/27 15:41:42 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -46,12 +46,11 @@ struct sdhc_pci_softc {
int sdhc_pci_match(struct device *, void *, void *);
void sdhc_pci_attach(struct device *, struct device *, void *);
-int sdhc_pci_activate(struct device *, int act);
void sdhc_takecontroller(struct pci_attach_args *);
struct cfattach sdhc_pci_ca = {
sizeof(struct sdhc_pci_softc), sdhc_pci_match, sdhc_pci_attach,
- NULL, sdhc_pci_activate
+ NULL, sdhc_activate
};
int
@@ -146,24 +145,10 @@ sdhc_pci_attach(struct device *parent, struct device *self, void *aux)
/*
* Establish power and shutdown hooks.
*/
- (void)powerhook_establish(sdhc_power, &sc->sc);
+ (void)powerhook_establish(sdhc_powerhook, &sc->sc);
(void)shutdownhook_establish(sdhc_shutdown, &sc->sc);
}
-int
-sdhc_pci_activate(struct device *self, int act)
-{
- switch (act) {
- case DVACT_SUSPEND:
- sdhc_power(PWR_SUSPEND, self);
- break;
- case DVACT_RESUME:
- sdhc_power(PWR_RESUME, self);
- break;
- }
- return (0);
-}
-
void
sdhc_takecontroller(struct pci_attach_args *pa)
{