Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Remove superfluous activation hook.



details:   https://anonhg.NetBSD.org/src/rev/a4a4a318369a
branches:  trunk
changeset: 748981:a4a4a318369a
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Thu Nov 12 19:20:08 2009 +0000

description:
Remove superfluous activation hook.

diffstat:

 sys/dev/ata/ata.c             |  66 +-----------------------------------------
 sys/dev/cardbus/ahc_cardbus.c |  31 +------------------
 2 files changed, 6 insertions(+), 91 deletions(-)

diffs (152 lines):

diff -r f32459b37436 -r a4a4a318369a sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Thu Nov 12 19:18:55 2009 +0000
+++ b/sys/dev/ata/ata.c Thu Nov 12 19:20:08 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ata.c,v 1.108 2009/10/19 18:41:12 bouyer Exp $ */
+/*     $NetBSD: ata.c,v 1.109 2009/11/12 19:20:08 dyoung Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.108 2009/10/19 18:41:12 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.109 2009/11/12 19:20:08 dyoung Exp $");
 
 #include "opt_ata.h"
 
@@ -474,66 +474,6 @@
 }
 
 /*
- * atabus_activate:
- *
- *     Autoconfiguration activation routine.
- */
-static int
-atabus_activate(device_t self, enum devact act)
-{
-       struct atabus_softc *sc = device_private(self);
-       struct ata_channel *chp = sc->sc_chan;
-       device_t dev = NULL;
-       int s, i, error = 0;
-
-       s = splbio();
-       switch (act) {
-       case DVACT_ACTIVATE:
-               error = EOPNOTSUPP;
-               break;
-
-       case DVACT_DEACTIVATE:
-               /*
-                * We might deactivate the children of atapibus twice
-                * (once bia atapibus, once directly), but since the
-                * generic autoconfiguration code maintains the DVF_ACTIVE
-                * flag, it's safe.
-                */
-               if ((dev = chp->atapibus) != NULL) {
-                       error = config_deactivate(dev);
-                       if (error)
-                               goto out;
-               }
-
-               for (i = 0; i < chp->ch_ndrive; i++) {
-                       if (chp->ch_drive[i].drive_flags & DRIVE_ATAPI)
-                               continue;
-                       if ((dev = chp->ch_drive[i].drv_softc) != NULL) {
-                               ATADEBUG_PRINT(("atabus_activate: %s: "
-                                   "deactivating %s\n", device_xname(self),
-                                   device_xname(dev)),
-                                   DEBUG_DETACH);
-                               error = config_deactivate(dev);
-                               if (error)
-                                       goto out;
-                       }
-               }
-               break;
-       }
- out:
-       splx(s);
-
-#ifdef ATADEBUG
-       if (dev != NULL && error != 0)
-               ATADEBUG_PRINT(("atabus_activate: %s: "
-                   "error %d deactivating %s\n", device_xname(self),
-                   error, device_xname(dev)), DEBUG_DETACH);
-#endif /* ATADEBUG */
-
-       return (error);
-}
-
-/*
  * atabus_detach:
  *
  *     Autoconfiguration detach routine.
@@ -638,7 +578,7 @@
 }
 
 CFATTACH_DECL3_NEW(atabus, sizeof(struct atabus_softc),
-    atabus_match, atabus_attach, atabus_detach, atabus_activate, NULL,
+    atabus_match, atabus_attach, atabus_detach, NULL, NULL,
     atabus_childdetached, DVF_DETACH_SHUTDOWN);
 
 /*****************************************************************************
diff -r f32459b37436 -r a4a4a318369a sys/dev/cardbus/ahc_cardbus.c
--- a/sys/dev/cardbus/ahc_cardbus.c     Thu Nov 12 19:18:55 2009 +0000
+++ b/sys/dev/cardbus/ahc_cardbus.c     Thu Nov 12 19:20:08 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahc_cardbus.c,v 1.28 2009/05/16 06:44:05 tsutsui Exp $ */
+/*     $NetBSD: ahc_cardbus.c,v 1.29 2009/11/12 19:21:03 dyoung Exp $  */
 
 /*-
  * Copyright (c) 2000, 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.28 2009/05/16 06:44:05 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.29 2009/11/12 19:21:03 dyoung Exp $");
 
 #include "opt_ahc_cardbus.h"
 
@@ -88,10 +88,9 @@
 int    ahc_cardbus_match(device_t, cfdata_t, void *);
 void   ahc_cardbus_attach(device_t, device_t, void *);
 int    ahc_cardbus_detach(device_t, int);
-int    ahc_activate(device_t self, enum devact act);
 
 CFATTACH_DECL_NEW(ahc_cardbus, sizeof(struct ahc_cardbus_softc),
-    ahc_cardbus_match, ahc_cardbus_attach, ahc_cardbus_detach, ahc_activate);
+    ahc_cardbus_match, ahc_cardbus_attach, ahc_cardbus_detach, NULL);
 
 int
 ahc_cardbus_match(device_t parent, cfdata_t match, void *aux)
@@ -285,27 +284,3 @@
 
        return (0);
 }
-
-
-int
-ahc_activate(device_t self, enum devact act)
-{
-       struct ahc_cardbus_softc *csc = device_private(self);
-       struct ahc_softc *ahc = &csc->sc_ahc;
-       int s, rv = 0;
-
-       s = splhigh();
-       switch (act) {
-       case DVACT_ACTIVATE:
-               rv = EOPNOTSUPP;
-               break;
-
-       case DVACT_DEACTIVATE:
-               if (ahc->sc_child != NULL)
-                       rv = config_deactivate(ahc->sc_child);
-               break;
-       }
-       splx(s);
-
-       return (rv);
-}



Home | Main Index | Thread Index | Old Index