summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2001-01-16 00:30:37 +0000
committermjacob <mjacob@FreeBSD.org>2001-01-16 00:30:37 +0000
commit7919bbf81bd80fa98115daa1298164135ea3c4eb (patch)
tree25767b9084ad295e370d1db3d54b64720d89842d /sys/cam
parentb83c97ff1c5117ad4e3b970a016114f7105e6aef (diff)
downloadFreeBSD-src-7919bbf81bd80fa98115daa1298164135ea3c4eb.zip
FreeBSD-src-7919bbf81bd80fa98115daa1298164135ea3c4eb.tar.gz
Get rid of those pesky "driver mistake" messages... destroy the create_d dev_t
when you take down the device. Reviewed by: audit@freebsd.org (Warner, Justin)
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_da.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index aa35550..aaadaa9 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -127,6 +127,7 @@ struct da_softc {
struct disk_params params;
struct disk disk;
union ccb saved_ccb;
+ dev_t dev;
};
struct da_quirk_entry {
@@ -899,6 +900,9 @@ dacleanup(struct cam_periph *periph)
cam_extend_release(daperiphs, periph->unit_number);
xpt_print_path(periph->path);
printf("removing device entry\n");
+ if (softc->dev) {
+ disk_destroy(softc->dev);
+ }
free(softc, M_DEVBUF);
}
@@ -1048,7 +1052,7 @@ daregister(struct cam_periph *periph, void *arg)
/*
* Register this media as a disk
*/
- disk_create(periph->unit_number, &softc->disk, 0,
+ softc->dev = disk_create(periph->unit_number, &softc->disk, 0,
&da_cdevsw, &dadisk_cdevsw);
/*
OpenPOWER on IntegriCloud