Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci pciide(4): Sprinkle static, add detachment support.



details:   https://anonhg.NetBSD.org/src/rev/b6db5e3fda1b
branches:  trunk
changeset: 758481:b6db5e3fda1b
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Fri Nov 05 19:50:18 2010 +0000

description:
pciide(4): Sprinkle static, add detachment support.

diffstat:

 sys/dev/pci/pciide.c |  31 ++++++++++++++++++++++++-------
 1 files changed, 24 insertions(+), 7 deletions(-)

diffs (66 lines):

diff -r a60582169f47 -r b6db5e3fda1b sys/dev/pci/pciide.c
--- a/sys/dev/pci/pciide.c      Fri Nov 05 19:48:43 2010 +0000
+++ b/sys/dev/pci/pciide.c      Fri Nov 05 19:50:18 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciide.c,v 1.217 2009/10/19 18:41:15 bouyer Exp $      */
+/*     $NetBSD: pciide.c,v 1.218 2010/11/05 19:50:18 jakllsch Exp $    */
 
 
 /*
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pciide.c,v 1.217 2009/10/19 18:41:15 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciide.c,v 1.218 2010/11/05 19:50:18 jakllsch Exp $");
 
 #include <sys/param.h>
 
@@ -78,13 +78,14 @@
 #include <dev/pci/pciidereg.h>
 #include <dev/pci/pciidevar.h>
 
-int    pciide_match(device_t, cfdata_t, void *);
-void   pciide_attach(device_t, device_t, void *);
+static int     pciide_match(device_t, cfdata_t, void *);
+static void    pciide_attach(device_t, device_t, void *);
+static int     pciide_detach(device_t, int);
 
 CFATTACH_DECL_NEW(pciide, sizeof(struct pciide_softc),
-    pciide_match, pciide_attach, NULL, NULL);
+    pciide_match, pciide_attach, pciide_detach, NULL);
 
-int
+static int
 pciide_match(device_t parent, cfdata_t match, void *aux)
 {
        struct pci_attach_args *pa = aux;
@@ -102,7 +103,7 @@
        return (0);
 }
 
-void
+static void
 pciide_attach(device_t parent, device_t self, void *aux)
 {
        struct pci_attach_args *pa = aux;
@@ -112,3 +113,19 @@
 
        pciide_common_attach(sc, pa, NULL);
 }
+
+static int
+pciide_detach(device_t self, int flags)
+{
+       struct pciide_softc *sc = device_private(self);
+       int ret;
+
+       ret = pciide_common_detach(sc, flags);
+
+       if (ret != 0)
+               return ret;
+
+       pci_intr_disestablish(sc->sc_pc, sc->sc_pci_ih);
+
+       return ret;
+}



Home | Main Index | Thread Index | Old Index