1369 rd_attach,
1370 rd_detach,
1371 nodev, /* reset */
1372 &rd_cb_ops,
1373 (struct bus_ops *)0,
1374 NULL,
1375 ddi_quiesce_not_needed, /* quiesce */
1376 };
1377
1378
1379 extern struct mod_ops mod_driverops;
1380
1381 static struct modldrv modldrv = {
1382 &mod_driverops,
1383 "ramdisk driver",
1384 &rd_ops
1385 };
1386
1387 static struct modlinkage modlinkage = {
1388 MODREV_1,
1389 &modldrv,
1390 0
1391 };
1392
1393 int
1394 _init(void)
1395 {
1396 int e;
1397
1398 if ((e = ddi_soft_state_init(&rd_statep,
1399 sizeof (rd_devstate_t), 0)) != 0) {
1400 return (e);
1401 }
1402
1403 mutex_init(&rd_lock, NULL, MUTEX_DRIVER, NULL);
1404
1405 if ((e = mod_install(&modlinkage)) != 0) {
1406 mutex_destroy(&rd_lock);
1407 ddi_soft_state_fini(&rd_statep);
1408 }
1409
1410 return (e);
|
1369 rd_attach,
1370 rd_detach,
1371 nodev, /* reset */
1372 &rd_cb_ops,
1373 (struct bus_ops *)0,
1374 NULL,
1375 ddi_quiesce_not_needed, /* quiesce */
1376 };
1377
1378
1379 extern struct mod_ops mod_driverops;
1380
1381 static struct modldrv modldrv = {
1382 &mod_driverops,
1383 "ramdisk driver",
1384 &rd_ops
1385 };
1386
1387 static struct modlinkage modlinkage = {
1388 MODREV_1,
1389 { &modldrv, NULL }
1390 };
1391
1392 int
1393 _init(void)
1394 {
1395 int e;
1396
1397 if ((e = ddi_soft_state_init(&rd_statep,
1398 sizeof (rd_devstate_t), 0)) != 0) {
1399 return (e);
1400 }
1401
1402 mutex_init(&rd_lock, NULL, MUTEX_DRIVER, NULL);
1403
1404 if ((e = mod_install(&modlinkage)) != 0) {
1405 mutex_destroy(&rd_lock);
1406 ddi_soft_state_fini(&rd_statep);
1407 }
1408
1409 return (e);
|