summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/driver_lyr.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/os/driver_lyr.c')
-rw-r--r--usr/src/uts/common/os/driver_lyr.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/usr/src/uts/common/os/driver_lyr.c b/usr/src/uts/common/os/driver_lyr.c
index 525fd399cc..fafb02ad89 100644
--- a/usr/src/uts/common/os/driver_lyr.c
+++ b/usr/src/uts/common/os/driver_lyr.c
@@ -382,7 +382,7 @@ handle_alloc(vnode_t *vp, struct ldi_ident *ident)
/* set the device type for this handle */
lhp->lh_type = 0;
- if (STREAMSTAB(getmajor(vp->v_rdev))) {
+ if (vp->v_stream) {
ASSERT(vp->v_type == VCHR);
lhp->lh_type |= LH_STREAM;
} else {
@@ -524,11 +524,6 @@ ldi_vp_from_dev(dev_t dev, int otyp, vnode_t **vpp)
if ((dip = e_ddi_hold_devi_by_dev(dev, 0)) == NULL)
return (ENODEV);
- if (STREAMSTAB(getmajor(dev)) && (otyp != OTYP_CHR)) {
- ddi_release_devi(dip); /* from e_ddi_hold_devi_by_dev */
- return (ENXIO);
- }
-
vp = makespecvp(dev, OTYP_TO_VTYP(otyp));
spec_assoc_vp_with_devi(vp, dip);
ddi_release_devi(dip); /* from e_ddi_hold_devi_by_dev */
@@ -3236,8 +3231,7 @@ ldi_ev_register_callbacks(ldi_handle_t lh, ldi_ev_cookie_t cookie,
*/
lecp->lec_lhp = lhp;
lecp->lec_dev = lhp->lh_vp->v_rdev;
- lecp->lec_spec = (lhp->lh_vp->v_type == VCHR) ?
- S_IFCHR : S_IFBLK;
+ lecp->lec_spec = VTYP_TO_STYP(lhp->lh_vp->v_type);
lecp->lec_notify = callb->cb_notify;
lecp->lec_finalize = callb->cb_finalize;
lecp->lec_arg = arg;