From a240cc0a68be1e10a03d12bd3b8247e457079f03 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Tue, 20 Dec 2016 15:45:30 +0000 Subject: Simplify the activate() functions of auglx(4), autri(4), and auvia(4). From Michael W. Bombardieri . Thanks. --- sys/dev/pci/auglx.c | 14 +++----------- sys/dev/pci/autri.c | 13 +++---------- sys/dev/pci/auvia.c | 15 +++------------ 3 files changed, 9 insertions(+), 33 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/auglx.c b/sys/dev/pci/auglx.c index 166a9530a74..4216555a498 100644 --- a/sys/dev/pci/auglx.c +++ b/sys/dev/pci/auglx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auglx.c,v 1.15 2016/09/19 06:46:44 ratchov Exp $ */ +/* $OpenBSD: auglx.c,v 1.16 2016/12/20 15:45:29 ratchov Exp $ */ /* * Copyright (c) 2008 Marc Balmer @@ -918,16 +918,8 @@ int auglx_activate(struct device *self, int act) { struct auglx_softc *sc = (struct auglx_softc *)self; - int rv = 0; - switch (act) { - case DVACT_RESUME: + if (act == DVACT_RESUME) ac97_resume(&sc->host_if, sc->codec_if); - rv = config_activate_children(self, act); - break; - default: - rv = config_activate_children(self, act); - break; - } - return (rv); + return (config_activate_children(self, act)); } diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c index 3ae587c7c31..51a91821811 100644 --- a/sys/dev/pci/autri.c +++ b/sys/dev/pci/autri.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autri.c,v 1.41 2016/09/19 06:46:44 ratchov Exp $ */ +/* $OpenBSD: autri.c,v 1.42 2016/12/20 15:45:29 ratchov Exp $ */ /* * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro. @@ -585,19 +585,12 @@ int autri_activate(struct device *self, int act) { struct autri_softc *sc = (struct autri_softc *)self; - int rv = 0; - switch (act) { - case DVACT_RESUME: + if (act == DVACT_RESUME) { autri_init(sc); ac97_resume(&sc->sc_codec.host_if, sc->sc_codec.codec_if); - rv = config_activate_children(self, act); - break; - default: - rv = config_activate_children(self, act); - break; } - return (rv); + return (config_activate_children(self, act)); } int diff --git a/sys/dev/pci/auvia.c b/sys/dev/pci/auvia.c index 6183eb05f07..c150b3e778b 100644 --- a/sys/dev/pci/auvia.c +++ b/sys/dev/pci/auvia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auvia.c,v 1.57 2016/09/19 06:46:44 ratchov Exp $ */ +/* $OpenBSD: auvia.c,v 1.58 2016/12/20 15:45:29 ratchov Exp $ */ /* $NetBSD: auvia.c,v 1.28 2002/11/04 16:38:49 kent Exp $ */ /*- @@ -229,21 +229,12 @@ int auvia_activate(struct device *self, int act) { struct auvia_softc *sc = (struct auvia_softc *)self; - int rv = 0; - switch (act) { - case DVACT_RESUME: + if (act == DVACT_RESUME) auvia_resume(sc); - rv = config_activate_children(self, act); - break; - default: - rv = config_activate_children(self, act); - break; - } - return (rv); + return (config_activate_children(self, act)); } - void auvia_attach(struct device *parent, struct device *self, void *aux) { -- cgit v1.2.3