summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2010-08-31 06:12:28 +0000
committerderaadt <deraadt@openbsd.org>2010-08-31 06:12:28 +0000
commit6ccc7c91d22d0549074c74d0a53d38a174028f19 (patch)
tree8216390ca366516637007e04427f361bf7ca6174
parentuhci is apparently is unaware that it could be on a shared interrupt (diff)
downloadwireguard-openbsd-6ccc7c91d22d0549074c74d0a53d38a174028f19.tar.xz
wireguard-openbsd-6ccc7c91d22d0549074c74d0a53d38a174028f19.zip
do not return EOPNOTSUPP for unknown activate actions
-rw-r--r--sys/dev/pci/auich.c20
-rw-r--r--sys/dev/pci/azalia.c24
2 files changed, 21 insertions, 23 deletions
diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c
index 2537fc028d4..54e6ec73e8c 100644
--- a/sys/dev/pci/auich.c
+++ b/sys/dev/pci/auich.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auich.c,v 1.87 2010/08/27 18:50:56 deraadt Exp $ */
+/* $OpenBSD: auich.c,v 1.88 2010/08/31 06:12:28 deraadt Exp $ */
/*
* Copyright (c) 2000,2001 Michael Shalayeff
@@ -565,23 +565,23 @@ int
auich_activate(struct device *self, int act)
{
struct auich_softc *sc = (struct auich_softc *)self;
- int ret = 0;
+ int rv = 0;
switch (act) {
case DVACT_ACTIVATE:
- return ret;
- case DVACT_DEACTIVATE:
- if (sc->audiodev != NULL)
- ret = config_deactivate(sc->audiodev);
- return ret;
+ break;
case DVACT_SUSPEND:
auich_suspend(sc);
- return ret;
+ break;
case DVACT_RESUME:
auich_resume(sc);
- return ret;
+ break;
+ case DVACT_DEACTIVATE:
+ if (sc->audiodev != NULL)
+ rv = config_deactivate(sc->audiodev);
+ break;
}
- return EOPNOTSUPP;
+ return (rv);
}
int
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
index 9438836c903..d4166acf547 100644
--- a/sys/dev/pci/azalia.c
+++ b/sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.c,v 1.183 2010/08/08 05:25:30 jakemsr Exp $ */
+/* $OpenBSD: azalia.c,v 1.184 2010/08/31 06:12:28 deraadt Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
@@ -536,26 +536,24 @@ err_exit:
int
azalia_pci_activate(struct device *self, int act)
{
- azalia_t *sc;
- int ret;
+ azalia_t *sc = (azalia_t*)self;
+ int rv = 0;
- sc = (azalia_t*)self;
- ret = 0;
switch (act) {
case DVACT_ACTIVATE:
- return ret;
- case DVACT_DEACTIVATE:
- if (sc->audiodev != NULL)
- ret = config_deactivate(sc->audiodev);
- return ret;
+ break;
case DVACT_SUSPEND:
azalia_suspend(sc);
- return ret;
+ break;
case DVACT_RESUME:
azalia_resume(sc);
- return ret;
+ break;
+ case DVACT_DEACTIVATE:
+ if (sc->audiodev != NULL)
+ rv = config_deactivate(sc->audiodev);
+ break;
}
- return EOPNOTSUPP;
+ return (rv);
}
int