summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2007-04-19 18:14:33 +0000
committerscottl <scottl@FreeBSD.org>2007-04-19 18:14:33 +0000
commit104ae1d6b1a5d6b411a340b3cd052e871a6dc818 (patch)
treeee30335e5e76ff48d64452a1b24a1dce45d85244 /sys/cam
parent908756daef4e51bf8db2d185e65149ce9b3fc6f0 (diff)
downloadFreeBSD-src-104ae1d6b1a5d6b411a340b3cd052e871a6dc818.zip
FreeBSD-src-104ae1d6b1a5d6b411a340b3cd052e871a6dc818.tar.gz
Avoid problems with make_dev.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_pt.c2
-rw-r--r--sys/cam/scsi/scsi_sa.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index 9f474d9..7201a58 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -303,9 +303,11 @@ ptctor(struct cam_periph *periph, void *arg)
SID_TYPE(&cgd->inq_data) | DEVSTAT_TYPE_IF_SCSI,
DEVSTAT_PRIORITY_OTHER);
+ cam_periph_unlock(periph);
softc->dev = make_dev(&pt_cdevsw, periph->unit_number, UID_ROOT,
GID_OPERATOR, 0600, "%s%d", periph->periph_name,
periph->unit_number);
+ cam_periph_lock(periph);
softc->dev->si_drv1 = periph;
/*
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index 170d35c..69d99d2 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -1521,6 +1521,7 @@ saregister(struct cam_periph *periph, void *arg)
DEVSTAT_BS_UNAVAILABLE, SID_TYPE(&cgd->inq_data) |
DEVSTAT_TYPE_IF_SCSI, DEVSTAT_PRIORITY_TAPE);
+ cam_periph_unlock(periph);
softc->devs.ctl_dev = make_dev(&sa_cdevsw, SAMINOR(SA_CTLDEV,
periph->unit_number, 0, SA_ATYPE_R), UID_ROOT, GID_OPERATOR,
0660, "%s%d.ctl", periph->periph_name, periph->unit_number);
@@ -1563,6 +1564,7 @@ saregister(struct cam_periph *periph, void *arg)
alias->si_drv1 = periph;
}
}
+ cam_periph_lock(periph);
/*
* Add an async callback so that we get
OpenPOWER on IntegriCloud