diff options
| author | dyoung <dyoung@NetBSD.org> | 2009-04-07 18:35:17 +0000 |
|---|---|---|
| committer | dyoung <dyoung@NetBSD.org> | 2009-04-07 18:35:17 +0000 |
| commit | 3098a4fbede4d3f2ecfbce869b93cfd046c7aec2 (patch) | |
| tree | 14bb032522d78561789bd4f92806c39b8caa5f2f /sys | |
| parent | 47c972421f42cf08ff307d4159c483c320bec82c (diff) | |
Detach atapibus(4), scsibus(4), cd(4), and sd(4) during shutdown.
Destroy sd->sc_callout in sddetach(). Delete some dead code in
cddetach().
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/scsipi/atapiconf.c | 8 | ||||
| -rw-r--r-- | sys/dev/scsipi/cd.c | 14 | ||||
| -rw-r--r-- | sys/dev/scsipi/scsiconf.c | 8 | ||||
| -rw-r--r-- | sys/dev/scsipi/sd.c | 10 |
4 files changed, 18 insertions, 22 deletions
diff --git a/sys/dev/scsipi/atapiconf.c b/sys/dev/scsipi/atapiconf.c index 102d48dacd3..2b0a388e16e 100644 --- a/sys/dev/scsipi/atapiconf.c +++ b/sys/dev/scsipi/atapiconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: atapiconf.c,v 1.77 2008/03/24 14:44:26 cube Exp $ */ +/* $NetBSD: atapiconf.c,v 1.78 2009/04/07 18:35:17 dyoung Exp $ */ /* * Copyright (c) 1996, 2001 Manuel Bouyer. All rights reserved. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: atapiconf.c,v 1.77 2008/03/24 14:44:26 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atapiconf.c,v 1.78 2009/04/07 18:35:17 dyoung Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -68,9 +68,9 @@ static int atapi_probe_bus(struct atapibus_softc *, int); static int atapibusprint(void *, const char *); -CFATTACH_DECL2_NEW(atapibus, sizeof(struct atapibus_softc), +CFATTACH_DECL3_NEW(atapibus, sizeof(struct atapibus_softc), atapibusmatch, atapibusattach, atapibusdetach, atapibusactivate, NULL, - atapibuschilddet); + atapibuschilddet, DVF_DETACH_SHUTDOWN); extern struct cfdriver atapibus_cd; diff --git a/sys/dev/scsipi/cd.c b/sys/dev/scsipi/cd.c index 2aa856e5fd2..b47abf2c329 100644 --- a/sys/dev/scsipi/cd.c +++ b/sys/dev/scsipi/cd.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd.c,v 1.291 2009/04/01 12:19:04 reinoud Exp $ */ +/* $NetBSD: cd.c,v 1.292 2009/04/07 18:35:17 dyoung Exp $ */ /*- * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation, @@ -50,7 +50,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.291 2009/04/01 12:19:04 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.292 2009/04/07 18:35:17 dyoung Exp $"); #include "rnd.h" @@ -181,8 +181,8 @@ static int mmc_setup_writeparams(struct scsipi_periph *, struct mmc_writeparams static void cd_set_properties(struct cd_softc *); -CFATTACH_DECL_NEW(cd, sizeof(struct cd_softc), cdmatch, cdattach, cddetach, - cdactivate); +CFATTACH_DECL3_NEW(cd, sizeof(struct cd_softc), cdmatch, cdattach, cddetach, + cdactivate, NULL, NULL, DVF_DETACH_SHUTDOWN); extern struct cfdriver cd_cd; @@ -354,12 +354,6 @@ cddetach(device_t self, int flags) disk_detach(&cd->sc_dk); disk_destroy(&cd->sc_dk); -#if 0 - /* Get rid of the shutdown hook. */ - if (cd->sc_sdhook != NULL) - shutdownhook_disestablish(cd->sc_sdhook); -#endif - #if NRND > 0 /* Unhook the entropy source. */ rnd_detach_source(&cd->rnd_source); diff --git a/sys/dev/scsipi/scsiconf.c b/sys/dev/scsipi/scsiconf.c index e144b0671ab..1c1387a501f 100644 --- a/sys/dev/scsipi/scsiconf.c +++ b/sys/dev/scsipi/scsiconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsiconf.c,v 1.250 2008/07/16 18:50:58 drochner Exp $ */ +/* $NetBSD: scsiconf.c,v 1.251 2009/04/07 18:35: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.250 2008/07/16 18:50:58 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.251 2009/04/07 18:35:17 dyoung Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -94,9 +94,9 @@ static int scsibusdetach(struct device *, int flags); static int scsibusrescan(struct device *, const char *, const int *); static void scsidevdetached(struct device *, struct device *); -CFATTACH_DECL2_NEW(scsibus, sizeof(struct scsibus_softc), +CFATTACH_DECL3_NEW(scsibus, sizeof(struct scsibus_softc), scsibusmatch, scsibusattach, scsibusdetach, scsibusactivate, - scsibusrescan, scsidevdetached); + scsibusrescan, scsidevdetached, DVF_DETACH_SHUTDOWN); extern struct cfdriver scsibus_cd; diff --git a/sys/dev/scsipi/sd.c b/sys/dev/scsipi/sd.c index 18604eeea9f..78b553dbcdc 100644 --- a/sys/dev/scsipi/sd.c +++ b/sys/dev/scsipi/sd.c @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.277 2009/01/13 13:35:54 yamt Exp $ */ +/* $NetBSD: sd.c,v 1.278 2009/04/07 18:35:17 dyoung Exp $ */ /*- * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc. @@ -47,7 +47,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.277 2009/01/13 13:35:54 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.278 2009/04/07 18:35:17 dyoung Exp $"); #include "opt_scsi.h" #include "rnd.h" @@ -129,8 +129,8 @@ static int sdactivate(struct device *, enum devact); static int sddetach(struct device *, int); static void sd_set_properties(struct sd_softc *); -CFATTACH_DECL_NEW(sd, sizeof(struct sd_softc), sdmatch, sdattach, sddetach, - sdactivate); +CFATTACH_DECL3_NEW(sd, sizeof(struct sd_softc), sdmatch, sdattach, sddetach, + sdactivate, NULL, NULL, DVF_DETACH_SHUTDOWN); extern struct cfdriver sd_cd; @@ -389,6 +389,8 @@ sddetach(struct device *self, int flags) disk_detach(&sd->sc_dk); disk_destroy(&sd->sc_dk); + callout_destroy(&sd->sc_callout); + pmf_device_deregister(self); shutdownhook_disestablish(sd->sc_sdhook); |
