Module Name: src Committed By: dyoung Date: Sun Dec 6 23:14:05 UTC 2009
Modified Files: src/sys/dev/pci: ifpci.c ifpci2.c isic_pci.c Log Message: Simplify device-activation hooks. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/ifpci.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/ifpci2.c cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/isic_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ifpci.c diff -u src/sys/dev/pci/ifpci.c:1.29 src/sys/dev/pci/ifpci.c:1.30 --- src/sys/dev/pci/ifpci.c:1.29 Thu Nov 26 15:17:10 2009 +++ src/sys/dev/pci/ifpci.c Sun Dec 6 23:14:05 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ifpci.c,v 1.29 2009/11/26 15:17:10 njoly Exp $ */ +/* $NetBSD: ifpci.c,v 1.30 2009/12/06 23:14:05 dyoung Exp $ */ /* * Copyright (c) 1999 Gary Jennejohn. All rights reserved. * @@ -36,14 +36,14 @@ * Fritz!Card PCI driver * ------------------------------------------------ * - * $Id: ifpci.c,v 1.29 2009/11/26 15:17:10 njoly Exp $ + * $Id: ifpci.c,v 1.30 2009/12/06 23:14:05 dyoung Exp $ * * last edit-date: [Fri Jan 5 11:38:58 2001] * *---------------------------------------------------------------------------*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ifpci.c,v 1.29 2009/11/26 15:17:10 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ifpci.c,v 1.30 2009/12/06 23:14:05 dyoung Exp $"); #include <sys/param.h> @@ -412,23 +412,17 @@ ifpci_activate(device_t self, enum devact act) { struct ifpci_softc *psc = device_private(self); - int error = 0, s; - s = splnet(); switch (act) { - case DVACT_ACTIVATE: - error = EOPNOTSUPP; - break; - case DVACT_DEACTIVATE: psc->sc_isic.sc_intr_valid = ISIC_INTR_DYING; isdn_layer2_status_ind(&psc->sc_isic.sc_l2, psc->sc_isic.sc_l3token, STI_ATTACH, 0); isdn_detach_isdnif(psc->sc_isic.sc_l3token); psc->sc_isic.sc_l3token = NULL; - break; + return 0; + default: + return EOPNOTSUPP; } - splx(s); - return (error); } /*---------------------------------------------------------------------------* Index: src/sys/dev/pci/ifpci2.c diff -u src/sys/dev/pci/ifpci2.c:1.18 src/sys/dev/pci/ifpci2.c:1.19 --- src/sys/dev/pci/ifpci2.c:1.18 Thu Nov 26 15:17:10 2009 +++ src/sys/dev/pci/ifpci2.c Sun Dec 6 23:14:05 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ifpci2.c,v 1.18 2009/11/26 15:17:10 njoly Exp $ */ +/* $NetBSD: ifpci2.c,v 1.19 2009/12/06 23:14:05 dyoung Exp $ */ /* * Copyright (c) 1999 Gary Jennejohn. All rights reserved. * @@ -36,14 +36,14 @@ * Fritz!Card PCI driver * ------------------------------------------------ * - * $Id: ifpci2.c,v 1.18 2009/11/26 15:17:10 njoly Exp $ + * $Id: ifpci2.c,v 1.19 2009/12/06 23:14:05 dyoung Exp $ * * last edit-date: [Fri Jan 5 11:38:58 2001] * *---------------------------------------------------------------------------*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ifpci2.c,v 1.18 2009/11/26 15:17:10 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ifpci2.c,v 1.19 2009/12/06 23:14:05 dyoung Exp $"); #include <sys/param.h> @@ -371,23 +371,17 @@ ifpci2_activate(device_t self, enum devact act) { struct ifpci_softc *psc = device_private(self); - int error = 0, s; - s = splnet(); switch (act) { - case DVACT_ACTIVATE: - error = EOPNOTSUPP; - break; - case DVACT_DEACTIVATE: psc->sc_isic.sc_intr_valid = ISIC_INTR_DYING; isdn_layer2_status_ind(&psc->sc_isic.sc_l2, psc->sc_isic.sc_l3token, STI_ATTACH, 0); isdn_detach_isdnif(psc->sc_isic.sc_l3token); psc->sc_isic.sc_l3token = NULL; - break; + return 0; + default: + return EOPNOTSUPP; } - splx(s); - return (error); } /*---------------------------------------------------------------------------* Index: src/sys/dev/pci/isic_pci.c diff -u src/sys/dev/pci/isic_pci.c:1.36 src/sys/dev/pci/isic_pci.c:1.37 --- src/sys/dev/pci/isic_pci.c:1.36 Thu Nov 26 15:17:10 2009 +++ src/sys/dev/pci/isic_pci.c Sun Dec 6 23:14:05 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: isic_pci.c,v 1.36 2009/11/26 15:17:10 njoly Exp $ */ +/* $NetBSD: isic_pci.c,v 1.37 2009/12/06 23:14:05 dyoung Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: isic_pci.c,v 1.36 2009/11/26 15:17:10 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_pci.c,v 1.37 2009/12/06 23:14:05 dyoung Exp $"); #include <sys/param.h> #include <sys/errno.h> @@ -313,19 +313,13 @@ isic_pci_activate(device_t self, enum devact act) { struct pci_isic_softc *psc = device_private(self); - int error = 0, s; - s = splnet(); switch (act) { - case DVACT_ACTIVATE: - error = EOPNOTSUPP; - break; - case DVACT_DEACTIVATE: psc->sc_isic.sc_intr_valid = ISIC_INTR_DYING; isic_detach_bri(&psc->sc_isic); - break; + return 0; + default: + return EOPNOTSUPP; } - splx(s); - return (error); }