diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c --- a/sys/dev/hptiop/hptiop.c +++ b/sys/dev/hptiop/hptiop.c @@ -166,7 +166,7 @@ }; #define hba_from_dev(dev) \ - ((struct hpt_iop_hba *)devclass_get_softc(hptiop_devclass, dev2unit(dev))) + ((struct hpt_iop_hba *)((dev)->si_drv1)) #define BUS_SPACE_WRT4_ITL(offset, value) bus_space_write_4(hba->bar0t,\ hba->bar0h, offsetof(struct hpt_iopmu_itl, offset), (value)) @@ -1870,6 +1870,7 @@ static int hptiop_attach(device_t dev) { + struct make_dev_args args; struct hpt_iop_hba *hba = (struct hpt_iop_hba *)device_get_softc(dev); struct hpt_iop_request_get_config iop_config; struct hpt_iop_request_set_config set_config; @@ -2068,10 +2069,14 @@ hba->ops->enable_intr(hba); hba->initialized = 1; - hba->ioctl_dev = make_dev(&hptiop_cdevsw, unit, - UID_ROOT, GID_WHEEL /*GID_OPERATOR*/, - S_IRUSR | S_IWUSR, "%s%d", driver_name, unit); + make_dev_args_init(&args); + args.mda_devsw = &hptiop_cdevsw; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_WHEEL /*GID_OPERATOR*/; + args.mda_mode = S_IRUSR | S_IWUSR; + args.mda_si_drv1 = hba; + make_dev_s(&args, &hba->ioctl_dev, "%s%d", driver_name, unit); return 0;