diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-31 06:12:29 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-31 06:12:29 +0000 |
commit | a3c5a70ad71e8adf3896b2779ca78e4278e02a2d (patch) | |
tree | 17819e3a92efbae94fc5c0edd776f4db98e902e8 | |
parent | 2b410527bbe8e0fbc80922870a570d5c2f6de0cb (diff) |
do not return EOPNOTSUPP for unknown activate actions
-rw-r--r-- | sys/dev/pci/auich.c | 20 | ||||
-rw-r--r-- | sys/dev/pci/azalia.c | 24 |
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 |