31c31
< __FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_sa.c 287289 2015-08-29 11:21:20Z mav $");
---
> __FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_sa.c 293350 2016-01-07 20:22:55Z kib $");
734,736d733
< if (periph == NULL)
< return (ENXIO);
<
909,912d905
< if (periph == NULL) {
< biofinish(bp, NULL, ENXIO);
< return;
< }
1520,1522d1512
< if (periph == NULL)
< return (ENXIO);
<
2288c2278
< dev->si_drv1 = softc->periph;
---
>
2349a2340
> struct make_dev_args args;
2351a2343
> int error;
2509,2511c2501,2514
< softc->devs.ctl_dev = make_dev(&sa_cdevsw, SAMINOR(SA_CTLDEV,
< SA_ATYPE_R), UID_ROOT, GID_OPERATOR,
< 0660, "%s%d.ctl", periph->periph_name, periph->unit_number);
---
> make_dev_args_init(&args);
> args.mda_devsw = &sa_cdevsw;
> args.mda_si_drv1 = softc->periph;
> args.mda_uid = UID_ROOT;
> args.mda_gid = GID_OPERATOR;
> args.mda_mode = 0660;
>
> args.mda_unit = SAMINOR(SA_CTLDEV, SA_ATYPE_R);
> error = make_dev_s(&args, &softc->devs.ctl_dev, "%s%d.ctl",
> periph->periph_name, periph->unit_number);
> if (error != 0) {
> cam_periph_lock(periph);
> return (CAM_REQ_CMP_ERR);
> }
2514,2516c2517,2523
< softc->devs.r_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV,
< SA_ATYPE_R), UID_ROOT, GID_OPERATOR,
< 0660, "%s%d", periph->periph_name, periph->unit_number);
---
> args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_R);
> error = make_dev_s(&args, &softc->devs.r_dev, "%s%d",
> periph->periph_name, periph->unit_number);
> if (error != 0) {
> cam_periph_lock(periph);
> return (CAM_REQ_CMP_ERR);
> }
2519,2521c2526,2532
< softc->devs.nr_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV,
< SA_ATYPE_NR), UID_ROOT, GID_OPERATOR,
< 0660, "n%s%d", periph->periph_name, periph->unit_number);
---
> args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_NR);
> error = make_dev_s(&args, &softc->devs.nr_dev, "n%s%d",
> periph->periph_name, periph->unit_number);
> if (error != 0) {
> cam_periph_lock(periph);
> return (CAM_REQ_CMP_ERR);
> }
2524,2527c2535,2542
< softc->devs.er_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV,
< SA_ATYPE_ER), UID_ROOT, GID_OPERATOR,
< 0660, "e%s%d", periph->periph_name, periph->unit_number);
< sasetupdev(softc, softc->devs.er_dev);
---
> args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_ER);
> error = make_dev_s(&args, &softc->devs.er_dev, "e%s%d",
> periph->periph_name, periph->unit_number);
> if (error != 0) {
> cam_periph_lock(periph);
> return (CAM_REQ_CMP_ERR);
> }
> sasetupdev(softc, softc->devs.er_dev);
< __FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_sa.c 287289 2015-08-29 11:21:20Z mav $");
---
> __FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_sa.c 293350 2016-01-07 20:22:55Z kib $");
734,736d733
< if (periph == NULL)
< return (ENXIO);
<
909,912d905
< if (periph == NULL) {
< biofinish(bp, NULL, ENXIO);
< return;
< }
1520,1522d1512
< if (periph == NULL)
< return (ENXIO);
<
2288c2278
< dev->si_drv1 = softc->periph;
---
>
2349a2340
> struct make_dev_args args;
2351a2343
> int error;
2509,2511c2501,2514
< softc->devs.ctl_dev = make_dev(&sa_cdevsw, SAMINOR(SA_CTLDEV,
< SA_ATYPE_R), UID_ROOT, GID_OPERATOR,
< 0660, "%s%d.ctl", periph->periph_name, periph->unit_number);
---
> make_dev_args_init(&args);
> args.mda_devsw = &sa_cdevsw;
> args.mda_si_drv1 = softc->periph;
> args.mda_uid = UID_ROOT;
> args.mda_gid = GID_OPERATOR;
> args.mda_mode = 0660;
>
> args.mda_unit = SAMINOR(SA_CTLDEV, SA_ATYPE_R);
> error = make_dev_s(&args, &softc->devs.ctl_dev, "%s%d.ctl",
> periph->periph_name, periph->unit_number);
> if (error != 0) {
> cam_periph_lock(periph);
> return (CAM_REQ_CMP_ERR);
> }
2514,2516c2517,2523
< softc->devs.r_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV,
< SA_ATYPE_R), UID_ROOT, GID_OPERATOR,
< 0660, "%s%d", periph->periph_name, periph->unit_number);
---
> args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_R);
> error = make_dev_s(&args, &softc->devs.r_dev, "%s%d",
> periph->periph_name, periph->unit_number);
> if (error != 0) {
> cam_periph_lock(periph);
> return (CAM_REQ_CMP_ERR);
> }
2519,2521c2526,2532
< softc->devs.nr_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV,
< SA_ATYPE_NR), UID_ROOT, GID_OPERATOR,
< 0660, "n%s%d", periph->periph_name, periph->unit_number);
---
> args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_NR);
> error = make_dev_s(&args, &softc->devs.nr_dev, "n%s%d",
> periph->periph_name, periph->unit_number);
> if (error != 0) {
> cam_periph_lock(periph);
> return (CAM_REQ_CMP_ERR);
> }
2524,2527c2535,2542
< softc->devs.er_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV,
< SA_ATYPE_ER), UID_ROOT, GID_OPERATOR,
< 0660, "e%s%d", periph->periph_name, periph->unit_number);
< sasetupdev(softc, softc->devs.er_dev);
---
> args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_ER);
> error = make_dev_s(&args, &softc->devs.er_dev, "e%s%d",
> periph->periph_name, periph->unit_number);
> if (error != 0) {
> cam_periph_lock(periph);
> return (CAM_REQ_CMP_ERR);
> }
> sasetupdev(softc, softc->devs.er_dev);