diff options
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/scsi/scsi_ch.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c index cc1bdb7..c8bf8a3 100644 --- a/sys/cam/scsi/scsi_ch.c +++ b/sys/cam/scsi/scsi_ch.c @@ -147,6 +147,7 @@ struct ch_softc { ch_quirks quirks; union ccb saved_ccb; struct devstat device_stats; + dev_t dev; int sc_picker; /* current picker */ @@ -270,9 +271,6 @@ chinit(void) if (status != CAM_REQ_CMP) { printf("ch: Failed to attach master async callback " "due to status 0x%x!\n", status); - } else { - /* If we were successfull, register our devsw */ - cdevsw_add(&ch_cdevsw); } } @@ -310,6 +308,7 @@ chcleanup(struct cam_periph *periph) softc = (struct ch_softc *)periph->softc; devstat_remove_entry(&softc->device_stats); + destroy_dev(softc->dev); cam_extend_release(chperiphs, periph->unit_number); xpt_print_path(periph->path); printf("removing device entry\n"); @@ -400,6 +399,11 @@ chregister(struct cam_periph *periph, void *arg) cgd->pd_type | DEVSTAT_TYPE_IF_SCSI, DEVSTAT_PRIORITY_OTHER); + /* Register the device */ + softc->dev = make_dev(&ch_cdevsw, periph->unit_number, UID_ROOT, + GID_OPERATOR, 0600, "%s%d", periph->periph_name, + periph->unit_number); + /* * Add an async callback so that we get * notified if this device goes away. |