Remove superfluous activation hook.

This commit is contained in:
dyoung 2009-11-12 19:20:08 +00:00
parent e4fd5e4f38
commit 310df30dc7
2 changed files with 6 additions and 91 deletions

View File

@ -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"
@ -473,66 +473,6 @@ atabus_attach(device_t parent, device_t self, void *aux)
aprint_error_dev(self, "couldn't establish power handler\n");
}
/*
* 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:
*
@ -638,7 +578,7 @@ atabus_childdetached(device_t self, device_t child)
}
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);
/*****************************************************************************

View File

@ -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 @@ struct ahc_cardbus_softc {
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 @@ ahc_cardbus_detach(device_t self, int flags)
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);
}