Remove superfluous activation hooks.
This commit is contained in:
parent
240fa6310f
commit
acb06354f1
|
@ -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 @@ const struct scsipi_periphsw atapi_probe_periphsw = {
|
|||
|
||||
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 atapi_probe_bus(struct atapibus_softc *, int);
|
|||
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 @@ atapibusattach(device_t parent, device_t self, void *aux)
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -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 scsi_probe_device(struct scsibus_softc *, int, int);
|
|||
|
||||
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;
|
||||
|
@ -235,42 +234,6 @@ scsibus_config(struct scsipi_channel *chan, void *arg)
|
|||
config_pending_decr();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue