summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/cam/scsi/scsi_target.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index d594260..f5f577f 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -133,7 +133,6 @@ struct targ_softc {
struct buf_queue_head rcv_buf_queue;
struct devstat device_stats;
dev_t targ_dev;
- dev_t ctl_dev;
struct selinfo snd_select;
struct selinfo rcv_select;
targ_state state;
@@ -232,11 +231,11 @@ static struct periph_driver targdriver =
DATA_SET(periphdriver_set, targdriver);
static struct extend_array *targperiphs;
+static dev_t targ_ctl_dev;
static void
targinit(void)
{
-
/*
* Create our extend array for storing the devices we attach to.
*/
@@ -245,6 +244,11 @@ targinit(void)
printf("targ: Failed to alloc extend array!\n");
return;
}
+ targ_ctl_dev = make_dev(&targ_cdevsw, TARG_CONTROL_UNIT, UID_ROOT,
+ GID_OPERATOR, 0600, "%s.ctl", "targ");
+ if (targ_ctl_dev == (dev_t) 0) {
+ printf("targ: failed to create control dev\n");
+ }
}
static void
@@ -491,10 +495,6 @@ targctor(struct cam_periph *periph, void *arg)
softc->targ_dev = make_dev(&targ_cdevsw, periph->unit_number, UID_ROOT,
GID_OPERATOR, 0600, "%s%d",
periph->periph_name, periph->unit_number);
- softc->ctl_dev = make_dev(&targ_cdevsw, TARG_CONTROL_UNIT, UID_ROOT,
- GID_OPERATOR, 0600, "%s%d.ctl",
- periph->periph_name, periph->unit_number);
-
softc->init_level++;
return (CAM_REQ_CMP);
}
@@ -518,7 +518,6 @@ targdtor(struct cam_periph *periph)
case 2:
free(softc->inq_data, M_DEVBUF);
destroy_dev(softc->targ_dev);
- destroy_dev(softc->ctl_dev);
/* FALLTHROUGH */
case 1:
free(softc, M_DEVBUF);
OpenPOWER on IntegriCloud