Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/5606a4c976e7
branches:  trunk
changeset: 748992:5606a4c976e7
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Thu Nov 12 19:44:17 2009 +0000

description:
Remove superfluous activation hooks.

diffstat:

 sys/dev/scsipi/atapiconf.c |  37 +++----------------------------------
 sys/dev/scsipi/scsiconf.c  |  43 +++----------------------------------------
 2 files changed, 6 insertions(+), 74 deletions(-)

diffs (148 lines):

diff -r 637161afcbf7 -r 5606a4c976e7 sys/dev/scsipi/atapiconf.c
--- a/sys/dev/scsipi/atapiconf.c        Thu Nov 12 19:39:26 2009 +0000
+++ b/sys/dev/scsipi/atapiconf.c        Thu Nov 12 19:44:17 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atapiconf.c,v 1.80 2009/10/19 18:41:16 bouyer Exp $    */
+/*     $NetBSD: atapiconf.c,v 1.81 2009/11/12 19:44:17 dyoung Exp $    */
 
 /*
  * Copyright (c) 1996, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atapiconf.c,v 1.80 2009/10/19 18:41:16 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atapiconf.c,v 1.81 2009/11/12 19:44:17 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -53,7 +53,6 @@
 
 static int     atapibusmatch(device_t, cfdata_t, void *);
 static void    atapibusattach(device_t, device_t, void *);
-static int     atapibusactivate(device_t, enum devact);
 static int     atapibusdetach(device_t, int flags);
 static void    atapibuschilddet(device_t, device_t);
 
@@ -64,7 +63,7 @@
 static int     atapibusprint(void *, const char *);
 
 CFATTACH_DECL3_NEW(atapibus, sizeof(struct atapibus_softc),
-    atapibusmatch, atapibusattach, atapibusdetach, atapibusactivate, NULL,
+    atapibusmatch, atapibusattach, atapibusdetach, NULL, NULL,
     atapibuschilddet, DVF_DETACH_SHUTDOWN);
 
 extern struct cfdriver atapibus_cd;
@@ -164,36 +163,6 @@
        atapi_probe_bus(sc, -1);
 }
 
-static int
-atapibusactivate(device_t self, enum devact act)
-{
-       struct atapibus_softc *sc = device_private(self);
-       struct scsipi_channel *chan = sc->sc_channel;
-       struct scsipi_periph *periph;
-       int target, error = 0, s;
-
-       s = splbio();
-       switch (act) {
-       case DVACT_ACTIVATE:
-               error = EOPNOTSUPP;
-               break;
-
-       case DVACT_DEACTIVATE:
-               for (target = 0; target < chan->chan_ntargets; target++) {
-                       periph = scsipi_lookup_periph(chan, target, 0);
-                       if (periph == NULL)
-                               continue;
-                       error = config_deactivate(periph->periph_dev);
-                       if (error)
-                               goto out;
-               }
-               break;
-       }
- out:
-       splx(s);
-       return (error);
-}
-
 static void
 atapibuschilddet(device_t self, device_t child)
 {
diff -r 637161afcbf7 -r 5606a4c976e7 sys/dev/scsipi/scsiconf.c
--- a/sys/dev/scsipi/scsiconf.c Thu Nov 12 19:39:26 2009 +0000
+++ b/sys/dev/scsipi/scsiconf.c Thu Nov 12 19:44:17 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsiconf.c,v 1.254 2009/10/21 21:12:05 rmind Exp $     */
+/*     $NetBSD: scsiconf.c,v 1.255 2009/11/12 19:44:17 dyoung Exp $    */
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.254 2009/10/21 21:12:05 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.255 2009/11/12 19:44:17 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -89,13 +89,12 @@
 
 static int     scsibusmatch(device_t, cfdata_t, void *);
 static void    scsibusattach(device_t, device_t, void *);
-static int     scsibusactivate(device_t, enum devact);
 static int     scsibusdetach(device_t, int flags);
 static int     scsibusrescan(device_t, const char *, const int *);
 static void    scsidevdetached(device_t, device_t);
 
 CFATTACH_DECL3_NEW(scsibus, sizeof(struct scsibus_softc),
-    scsibusmatch, scsibusattach, scsibusdetach, scsibusactivate,
+    scsibusmatch, scsibusattach, scsibusdetach, NULL,
     scsibusrescan, scsidevdetached, DVF_DETACH_SHUTDOWN);
 
 extern struct cfdriver scsibus_cd;
@@ -236,42 +235,6 @@
 }
 
 static int
-scsibusactivate(device_t self, enum devact act)
-{
-       struct scsibus_softc *sc = device_private(self);
-       struct scsipi_channel *chan = sc->sc_channel;
-       struct scsipi_periph *periph;
-       int target, lun, error = 0, s;
-
-       s = splbio();
-       switch (act) {
-       case DVACT_ACTIVATE:
-               error = EOPNOTSUPP;
-               break;
-
-       case DVACT_DEACTIVATE:
-               for (target = 0; target < chan->chan_ntargets;
-                    target++) {
-                       if (target == chan->chan_id)
-                               continue;
-                       for (lun = 0; lun < chan->chan_nluns; lun++) {
-                               periph = scsipi_lookup_periph(chan,
-                                   target, lun);
-                               if (periph == NULL)
-                                       continue;
-                               error = config_deactivate(periph->periph_dev);
-                               if (error)
-                                       goto out;
-                       }
-               }
-               break;
-       }
- out:
-       splx(s);
-       return (error);
-}
-
-static int
 scsibusdetach(device_t self, int flags)
 {
        struct scsibus_softc *sc = device_private(self);



Home | Main Index | Thread Index | Old Index