Prepare for future integration between CAM and newbus. xpt_bus_register

now takes a device_t to be the parent of the bus that is being created.
Most SIMs have been updated with a reasonable argument, but a few exceptions
just pass NULL for now.  This argument isn't used yet and the newbus
integration likely won't be ready until after 7.0-RELEASE.
This commit is contained in:
Scott Long 2007-06-17 05:55:54 +00:00
parent 6eb9bbf329
commit b50569b71d
49 changed files with 68 additions and 53 deletions

View File

@ -197,6 +197,7 @@ struct cam_eb {
#define CAM_EB_RUNQ_SCHEDULED 0x01
u_int32_t refcount;
u_int generation;
device_t parent_dev;
};
struct cam_path {
@ -1505,7 +1506,7 @@ xpt_init(void *dummy)
xpt_sim->max_ccbs = 16;
mtx_lock(&xsoftc.xpt_lock);
if ((status = xpt_bus_register(xpt_sim, /*bus #*/0)) != CAM_SUCCESS) {
if ((status = xpt_bus_register(xpt_sim, NULL, 0)) != CAM_SUCCESS) {
printf("xpt_init: xpt_bus_register failed with status %#x,"
" failing attach\n", status);
return (EINVAL);
@ -4320,7 +4321,7 @@ xpt_release_ccb(union ccb *free_ccb)
* availible, the bus will be probed.
*/
int32_t
xpt_bus_register(struct cam_sim *sim, u_int32_t bus)
xpt_bus_register(struct cam_sim *sim, device_t parent, u_int32_t bus)
{
struct cam_eb *new_bus;
struct cam_eb *old_bus;

View File

@ -37,7 +37,8 @@
/* Functions accessed by SIM drivers */
#ifdef _KERNEL
int32_t xpt_bus_register(struct cam_sim *sim, u_int32_t bus);
int32_t xpt_bus_register(struct cam_sim *sim, device_t parent,
u_int32_t bus);
int32_t xpt_bus_deregister(path_id_t path_id);
u_int32_t xpt_freeze_simq(struct cam_sim *sim, u_int count);
void xpt_release_simq(struct cam_sim *sim, int run_queue);

View File

@ -1351,7 +1351,7 @@ scsi_low_attach_cam(slp)
return ENODEV;
}
if (xpt_bus_register(slp->sl_si.sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(slp->sl_si.sim, NULL, 0) != CAM_SUCCESS) {
free(slp->sl_si.sim, M_SCSILOW);
return ENODEV;
}

View File

@ -178,7 +178,7 @@ aac_cam_attach(device_t dev)
}
/* Since every bus has it's own sim, every bus 'appears' as bus 0 */
if (xpt_bus_register(sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(sim, dev, 0) != CAM_SUCCESS) {
cam_sim_free(sim, TRUE);
return (EIO);
}

View File

@ -1423,7 +1423,7 @@ adv_attach(adv)
*
* XXX Twin Channel EISA Cards???
*/
if (xpt_bus_register(adv->sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(adv->sim, adv->dev, 0) != CAM_SUCCESS) {
cam_sim_free(adv->sim, /*free devq*/TRUE);
return (ENXIO);
}

View File

@ -493,7 +493,7 @@ struct adv_target_transinfo {
};
struct adv_softc {
device_t dev;
device_t dev;
bus_space_tag_t tag;
bus_space_handle_t bsh;
struct cam_sim *sim;

View File

@ -1243,7 +1243,7 @@ adw_attach(struct adw_softc *adw)
/*
* Register the bus.
*/
if (xpt_bus_register(adw->sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(adw->sim, adw->device, 0) != CAM_SUCCESS) {
cam_sim_free(adw->sim, /*free devq*/TRUE);
error = ENOMEM;
goto fail;

View File

@ -611,7 +611,7 @@ aha_attach(struct aha_softc *aha)
cam_simq_free(devq);
return (ENOMEM);
}
if (xpt_bus_register(aha->sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(aha->sim, aha->dev, 0) != CAM_SUCCESS) {
cam_sim_free(aha->sim, /*free_devq*/TRUE);
return (ENXIO);
}

View File

@ -69,7 +69,7 @@
bus_space_write_4((ahb)->tag, (ahb)->bsh, port, value)
static const char *ahbmatch(eisa_id_t type);
static struct ahb_softc *ahballoc(u_long unit, struct resource *res);
static struct ahb_softc *ahballoc(device_t dev, struct resource *res);
static void ahbfree(struct ahb_softc *ahb);
static int ahbreset(struct ahb_softc *ahb);
static void ahbmapecbs(void *arg, bus_dma_segment_t *segs,
@ -271,7 +271,7 @@ ahbattach(device_t dev)
return ENOMEM;
}
if ((ahb = ahballoc(device_get_unit(dev), io)) == NULL) {
if ((ahb = ahballoc(dev, io)) == NULL) {
goto error_exit2;
}
@ -400,7 +400,7 @@ error_exit2:
}
static struct ahb_softc *
ahballoc(u_long unit, struct resource *res)
ahballoc(device_t dev, struct resource *res)
{
struct ahb_softc *ahb;
@ -414,11 +414,12 @@ ahballoc(u_long unit, struct resource *res)
}
SLIST_INIT(&ahb->free_ecbs);
LIST_INIT(&ahb->pending_ccbs);
ahb->unit = unit;
ahb->unit = device_get_unit(dev);
ahb->tag = rman_get_bustag(res);
ahb->bsh = rman_get_bushandle(res);
ahb->disc_permitted = ~0;
ahb->tags_permitted = ~0;
ahb->dev = dev;
return (ahb);
}
@ -559,7 +560,7 @@ ahbxptattach(struct ahb_softc *ahb)
return (ENOMEM);
}
if (xpt_bus_register(ahb->sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(ahb->sim, ahb->dev, 0) != CAM_SUCCESS) {
cam_sim_free(ahb->sim, /*free_devq*/TRUE);
return (ENXIO);
}

View File

@ -258,6 +258,7 @@ struct ecb {
};
struct ahb_softc {
device_t dev;
bus_space_tag_t tag;
bus_space_handle_t bsh;
struct cam_sim *sim;

View File

@ -1549,7 +1549,7 @@ aic_attach(struct aic_softc *aic)
return (ENOMEM);
}
if (xpt_bus_register(aic->sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(aic->sim, aic->dev, 0) != CAM_SUCCESS) {
cam_sim_free(aic->sim, /*free_devq*/TRUE);
return (ENXIO);
}

View File

@ -125,6 +125,7 @@ aic_isa_alloc_resources(device_t dev)
}
}
sc->sc_aic.dev = dev;
sc->sc_aic.unit = device_get_unit(dev);
sc->sc_aic.tag = rman_get_bustag(sc->sc_port);
sc->sc_aic.bsh = rman_get_bushandle(sc->sc_port);

View File

@ -101,6 +101,7 @@ aic_isa_alloc_resources(device_t dev)
}
}
sc->sc_aic.dev = dev;
sc->sc_aic.unit = device_get_unit(dev);
sc->sc_aic.tag = rman_get_bustag(sc->sc_port);
sc->sc_aic.bsh = rman_get_bushandle(sc->sc_port);

View File

@ -86,6 +86,7 @@ aic_pccard_alloc_resources(device_t dev)
return (ENOMEM);
}
sc->sc_aic.dev = dev;
sc->sc_aic.unit = device_get_unit(dev);
sc->sc_aic.tag = rman_get_bustag(sc->sc_port);
sc->sc_aic.bsh = rman_get_bushandle(sc->sc_port);

View File

@ -69,6 +69,7 @@ struct aic_scb {
enum { AIC6260, AIC6360, AIC6370, GM82C700 };
struct aic_softc {
device_t dev;
int unit;
bus_space_tag_t tag;
bus_space_handle_t bsh;

View File

@ -148,7 +148,7 @@ ahd_attach(struct ahd_softc *ahd)
goto fail;
}
if (xpt_bus_register(sim, /*bus_id*/0) != CAM_SUCCESS) {
if (xpt_bus_register(sim, ahd->dev_softc, /*bus_id*/0) != CAM_SUCCESS) {
cam_sim_free(sim, /*free_devq*/TRUE);
sim = NULL;
goto fail;

View File

@ -202,7 +202,7 @@ ahc_attach(struct ahc_softc *ahc)
goto fail;
}
if (xpt_bus_register(sim, bus_id) != CAM_SUCCESS) {
if (xpt_bus_register(sim, ahc->dev_softc, bus_id) != CAM_SUCCESS) {
cam_sim_free(sim, /*free_devq*/TRUE);
sim = NULL;
goto fail;
@ -237,7 +237,8 @@ ahc_attach(struct ahc_softc *ahc)
goto fail;
}
if (xpt_bus_register(sim2, bus_id2) != CAM_SUCCESS) {
if (xpt_bus_register(sim2, ahc->dev_softc, bus_id2) !=
CAM_SUCCESS) {
printf("ahc_attach: Unable to attach second "
"bus due to resource shortage");
/*

View File

@ -2491,7 +2491,7 @@ amd_attach(device_t dev)
return ENXIO;
}
if (xpt_bus_register(amd->psim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(amd->psim, dev, 0) != CAM_SUCCESS) {
cam_sim_free(amd->psim, /*free_devq*/TRUE);
if (bootverbose)
printf("amd_attach: xpt_bus_register failure!\n");

View File

@ -158,7 +158,7 @@ amr_cam_attach(struct amr_softc *sc)
}
/* register the bus ID so we can get it later */
if (xpt_bus_register(sc->amr_cam_sim[chn], chn)) {
if (xpt_bus_register(sc->amr_cam_sim[chn], sc->amr_dev, chn)) {
device_printf(sc->amr_dev, "CAM XPT bus registration failed\n");
return(ENXIO);
}

View File

@ -2155,7 +2155,7 @@ static u_int32_t arcmsr_attach(device_t dev)
printf("arcmsr%d: cam_sim_alloc failure!\n", unit);
return ENXIO;
}
if(xpt_bus_register(acb->psim, 0) != CAM_SUCCESS) {
if(xpt_bus_register(acb->psim, dev, 0) != CAM_SUCCESS) {
arcmsr_free_resource(acb);
bus_release_resource(dev, SYS_RES_IRQ, 0, acb->irqres);
cam_sim_free(acb->psim, /*free_devq*/TRUE);

View File

@ -2657,7 +2657,7 @@ asr_attach(device_t dev)
continue;
}
if (xpt_bus_register(sc->ha_sim[bus], bus) != CAM_SUCCESS) {
if (xpt_bus_register(sc->ha_sim[bus], dev, bus) != CAM_SUCCESS){
cam_sim_free(sc->ha_sim[bus],
/*free_devq*/TRUE);
sc->ha_sim[bus] = NULL;

View File

@ -218,7 +218,7 @@ atapi_cam_attach(device_t dev)
scp->sim = sim;
mtx_lock(&scp->state_lock);
if (xpt_bus_register(sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(sim, dev, 0) != CAM_SUCCESS) {
error = EINVAL;
mtx_unlock(&scp->state_lock);
goto out;

View File

@ -880,7 +880,7 @@ bt_attach(device_t dev)
return (ENOMEM);
}
if (xpt_bus_register(bt->sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(bt->sim, dev, 0) != CAM_SUCCESS) {
cam_sim_free(bt->sim, /*free_devq*/TRUE);
return (ENXIO);
}

View File

@ -2503,7 +2503,7 @@ ciss_cam_init(struct ciss_softc *sc)
*/
mtx_lock(&sc->ciss_mtx);
if (i == 0 || sc->ciss_controllers[i].physical.bus != 0) {
if (xpt_bus_register(sc->ciss_cam_sim[i], i) != 0) {
if (xpt_bus_register(sc->ciss_cam_sim[i], sc->ciss_dev, i) != 0) {
ciss_printf(sc, "can't register SCSI bus %d\n", i);
mtx_unlock(&sc->ciss_mtx);
return (ENXIO);
@ -2525,7 +2525,7 @@ ciss_cam_init(struct ciss_softc *sc)
}
mtx_lock(&sc->ciss_mtx);
if (xpt_bus_register(sc->ciss_cam_sim[i], i) != 0) {
if (xpt_bus_register(sc->ciss_cam_sim[i], sc->ciss_dev, i) != 0) {
ciss_printf(sc, "can't register SCSI bus %d\n", i);
mtx_unlock(&sc->ciss_mtx);
return (ENXIO);

View File

@ -1018,6 +1018,7 @@ struct sg_map_node {
/* Main state machine and interface structure */
typedef struct dpt_softc {
device_t dev;
struct resource * io_res;
int io_rid;

View File

@ -109,6 +109,7 @@ dpt_eisa_attach (device_t dev)
int error = 0;
dpt = device_get_softc(dev);
dpt->dev = dev;
dpt->io_rid = 0;
dpt->io_type = SYS_RES_IOPORT;

View File

@ -154,7 +154,7 @@ dpt_isa_attach (device_t dev)
int error = 0;
dpt = device_get_softc(dev);
dpt->dev = dev;
dpt->io_rid = 0;
dpt->io_type = SYS_RES_IOPORT;

View File

@ -81,6 +81,7 @@ dpt_pci_attach (device_t dev)
u_int32_t command;
dpt = device_get_softc(dev);
dpt->dev = dev;
command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1);

View File

@ -1579,7 +1579,7 @@ dpt_attach(dpt_softc_t *dpt)
break;
}
if (xpt_bus_register(dpt->sims[i], i) != CAM_SUCCESS) {
if (xpt_bus_register(dpt->sims[i], dpt->dev, i) != CAM_SUCCESS){
cam_sim_free(dpt->sims[i], /*free_devq*/i == 0);
dpt->sims[i] = NULL;
break;

View File

@ -332,7 +332,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *sc)
error = ENOMEM;
goto fail_devq;
}
if (xpt_bus_register(sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(sim, sc->sc_dev, 0) != CAM_SUCCESS) {
device_printf(sc->sc_dev, "cannot register bus\n");
error = EIO;
goto fail_sim;

View File

@ -2033,7 +2033,7 @@ END_DEBUG
}
SBP_LOCK(sbp);
if (xpt_bus_register(sbp->sim, /*bus*/0) != CAM_SUCCESS)
if (xpt_bus_register(sbp->sim, dev, /*bus*/0) != CAM_SUCCESS)
goto fail;
if (xpt_create_path(&sbp->path, xpt_periph, cam_sim_path(sbp->sim),

View File

@ -1703,7 +1703,7 @@ sbp_targ_attach(device_t dev)
}
SBP_LOCK(sc);
if (xpt_bus_register(sc->sim, /*bus*/0) != CAM_SUCCESS)
if (xpt_bus_register(sc->sim, dev, /*bus*/0) != CAM_SUCCESS)
goto fail;
if (xpt_create_path(&sc->path, /*periph*/ NULL, cam_sim_path(sc->sim),

View File

@ -681,7 +681,7 @@ attach_failed:
goto attach_failed;
}
if (xpt_bus_register(hba->sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(hba->sim, dev, 0) != CAM_SUCCESS) {
printf("hptiop: xpt_bus_register failed\n");
cam_sim_free(hba->sim, /*free devq*/ TRUE);
hba->sim = NULL;

View File

@ -1966,7 +1966,7 @@ hpt_attach(device_t dev)
return ENOMEM;
}
if(xpt_bus_register(hpt_vsim, 0) != CAM_SUCCESS)
if(xpt_bus_register(hpt_vsim, dev, 0) != CAM_SUCCESS)
{
cam_sim_free(hpt_vsim, /*free devq*/ TRUE);
hpt_vsim = NULL;

View File

@ -505,7 +505,7 @@ iir_attach(struct gdt_softc *gdt)
gdt, gdt->sc_hanum, &Giant,
/*untagged*/1,
/*tagged*/GDT_MAXCMDS, devq);
if (xpt_bus_register(gdt->sims[i], i) != CAM_SUCCESS) {
if (xpt_bus_register(gdt->sims[i], gdt->sc_devnode, i) != CAM_SUCCESS) {
cam_sim_free(gdt->sims[i], /*free_devq*/i == 0);
break;
}

View File

@ -590,6 +590,7 @@ struct gdt_intr_ctx {
/* softc structure */
struct gdt_softc {
device_t sc_devnode;
int sc_hanum;
int sc_class; /* Controller class */
#define GDT_MPR 0x05

View File

@ -209,7 +209,7 @@ iir_pci_attach(device_t dev)
}
gdt = device_get_softc(dev);
bzero(gdt, sizeof(struct gdt_softc));
gdt->sc_devnode = dev;
gdt->sc_init_level = 0;
gdt->sc_dpmemt = rman_get_bustag(io);
gdt->sc_dpmemh = rman_get_bushandle(io);

View File

@ -156,7 +156,7 @@ isp_attach(ispsoftc_t *isp)
}
ISP_LOCK(isp);
if (xpt_bus_register(sim, primary) != CAM_SUCCESS) {
if (xpt_bus_register(sim, isp->isp_dev, primary) != CAM_SUCCESS) {
cam_sim_free(sim, TRUE);
return;
}
@ -191,7 +191,8 @@ isp_attach(ispsoftc_t *isp)
config_intrhook_disestablish(&isp->isp_osinfo.ehook);
return;
}
if (xpt_bus_register(sim, secondary) != CAM_SUCCESS) {
if (xpt_bus_register(sim, isp->isp_dev, secondary) !=
CAM_SUCCESS) {
xpt_bus_deregister(cam_sim_path(isp->isp_sim));
xpt_free_path(isp->isp_path);
cam_sim_free(sim, TRUE);

View File

@ -134,7 +134,7 @@ mfip_attach(device_t dev)
}
mtx_lock(&mfisc->mfi_io_lock);
if (xpt_bus_register(sc->sim, 0) != 0) {
if (xpt_bus_register(sc->sim, dev, 0) != 0) {
device_printf(dev, "XPT bus registration failed\n");
cam_sim_free(sc->sim, FALSE);
cam_simq_free(sc->devq);

View File

@ -1950,7 +1950,7 @@ mly_cam_attach(struct mly_softc *sc)
1, devq)) == NULL) {
return(ENOMEM);
}
if (xpt_bus_register(sc->mly_cam_sim[chn], chn)) {
if (xpt_bus_register(sc->mly_cam_sim[chn], sc->mly_dev, chn)) {
mly_printf(sc, "CAM XPT phsyical channel registration failed\n");
return(ENXIO);
}
@ -1970,7 +1970,7 @@ mly_cam_attach(struct mly_softc *sc)
0, devq)) == NULL) {
return(ENOMEM);
}
if (xpt_bus_register(sc->mly_cam_sim[chn], chn)) {
if (xpt_bus_register(sc->mly_cam_sim[chn], sc->mly_dev, chn)) {
mly_printf(sc, "CAM XPT virtual channel registration failed\n");
return(ENXIO);
}

View File

@ -323,7 +323,7 @@ mpt_cam_attach(struct mpt_softc *mpt)
/*
* Create the device queue for our SIM(s).
*/
devq = cam_simq_alloc(maxq);
devq = cam_simq_alloc(1);
if (devq == NULL) {
mpt_prt(mpt, "Unable to allocate CAM SIMQ!\n");
error = ENOMEM;
@ -334,7 +334,7 @@ mpt_cam_attach(struct mpt_softc *mpt)
* Construct our SIM entry.
*/
mpt->sim =
mpt_sim_alloc(mpt_action, mpt_poll, "mpt", mpt, 1, maxq, devq);
mpt_sim_alloc(mpt_action, mpt_poll, "mpt", mpt, 1, 1, devq);
if (mpt->sim == NULL) {
mpt_prt(mpt, "Unable to allocate CAM SIM!\n");
cam_simq_free(devq);
@ -346,7 +346,7 @@ mpt_cam_attach(struct mpt_softc *mpt)
* Register exactly this bus.
*/
MPT_LOCK(mpt);
if (xpt_bus_register(mpt->sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(mpt->sim, mpt->dev, 0) != CAM_SUCCESS) {
mpt_prt(mpt, "Bus registration Failed!\n");
error = ENOMEM;
MPT_UNLOCK(mpt);
@ -374,7 +374,7 @@ mpt_cam_attach(struct mpt_softc *mpt)
* Create a "bus" to export all hidden disks to CAM.
*/
mpt->phydisk_sim =
mpt_sim_alloc(mpt_action, mpt_poll, "mpt", mpt, 1, maxq, devq);
mpt_sim_alloc(mpt_action, mpt_poll, "mpt", mpt, 1, 1, devq);
if (mpt->phydisk_sim == NULL) {
mpt_prt(mpt, "Unable to allocate Physical Disk CAM SIM!\n");
error = ENOMEM;
@ -385,7 +385,7 @@ mpt_cam_attach(struct mpt_softc *mpt)
* Register this bus.
*/
MPT_LOCK(mpt);
if (xpt_bus_register(mpt->phydisk_sim, 1) != CAM_SUCCESS) {
if (xpt_bus_register(mpt->phydisk_sim, mpt->dev, 1) != CAM_SUCCESS) {
mpt_prt(mpt, "Physical Disk Bus registration Failed!\n");
error = ENOMEM;
MPT_UNLOCK(mpt);

View File

@ -169,7 +169,7 @@ vpo_attach(device_t dev)
return (ENXIO);
}
if (xpt_bus_register(vpo->sim, /*bus*/0) != CAM_SUCCESS) {
if (xpt_bus_register(vpo->sim, dev, /*bus*/0) != CAM_SUCCESS) {
cam_sim_free(vpo->sim, /*free_devq*/TRUE);
return (ENXIO);
}

View File

@ -1097,7 +1097,8 @@ static void hpt_final_init(void *dummy)
return ;
}
if (xpt_bus_register(vbus_ext->sim, 0) != CAM_SUCCESS) {
/* XXX No single device parent */
if (xpt_bus_register(vbus_ext->sim, NULL, 0) != CAM_SUCCESS) {
os_printk("xpt_bus_register failed");
cam_sim_free(vbus_ext->sim, /*free devq*/ TRUE);
vbus_ext->sim = NULL;

View File

@ -8978,7 +8978,7 @@ static int sym_cam_attach(hcb_p np)
goto fail;
devq = 0;
if (xpt_bus_register(sim, 0) != CAM_SUCCESS)
if (xpt_bus_register(sim, np->device, 0) != CAM_SUCCESS)
goto fail;
np->sim = sim;
sim = 0;

View File

@ -3645,7 +3645,7 @@ trm_attach(device_t dev)
cam_simq_free(device_Q); /* SIM allocate fault*/
goto bad;
}
if (xpt_bus_register(pACB->psim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(pACB->psim, dev, 0) != CAM_SUCCESS) {
printf("trm%d: xpt_bus_register fault !\n",unit);
goto bad;
}

View File

@ -121,7 +121,7 @@ tw_osli_cam_attach(struct twa_softc *sc)
*/
tw_osli_dbg_dprintf(3, sc, "Calling xpt_bus_register");
mtx_lock(&Giant);
if (xpt_bus_register(sc->sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(sc->sim, sc->bus_dev, 0) != CAM_SUCCESS) {
cam_sim_free(sc->sim, TRUE);
sc->sim = NULL; /* so cam_detach will not try to free it */
tw_osli_printf(sc, "error = %d",

View File

@ -2263,7 +2263,7 @@ umass_cam_attach_sim(struct umass_softc *sc)
return(ENOMEM);
}
if(xpt_bus_register(sc->umass_sim, device_get_unit(sc->sc_dev)) !=
if(xpt_bus_register(sc->umass_sim, NULL, device_get_unit(sc->sc_dev)) !=
CAM_SUCCESS)
return(ENOMEM);

View File

@ -614,7 +614,7 @@ wds_attach(device_t dev)
}
wp->sim = sim;
if (xpt_bus_register(sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(sim, dev, 0) != CAM_SUCCESS) {
cam_sim_free(sim, /* free_devq */ TRUE);
goto bad;
}

View File

@ -3784,7 +3784,7 @@ ncr_attach (device_t dev)
}
if (xpt_bus_register(np->sim, 0) != CAM_SUCCESS) {
if (xpt_bus_register(np->sim, dev, 0) != CAM_SUCCESS) {
cam_sim_free(np->sim, /*free_devq*/ TRUE);
return ENOMEM;
}