--- old/usr/src/uts/common/io/mr_sas/mr_sas.c	Tue Nov  6 14:28:29 2012
+++ new/usr/src/uts/common/io/mr_sas/mr_sas.c	Tue Nov  6 14:28:28 2012
@@ -736,45 +736,40 @@
 
 		/* Initialize all Mutex */
 		INIT_LIST_HEAD(&instance->completed_pool_list);
-		mutex_init(&instance->completed_pool_mtx,
-		    "completed_pool_mtx", MUTEX_DRIVER,
-		    DDI_INTR_PRI(instance->intr_pri));
+		mutex_init(&instance->completed_pool_mtx, NULL,
+		    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 
-		mutex_init(&instance->sync_map_mtx,
-		    "sync_map_mtx", MUTEX_DRIVER,
-		    DDI_INTR_PRI(instance->intr_pri));
+		mutex_init(&instance->sync_map_mtx, NULL,
+		    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 
-		mutex_init(&instance->app_cmd_pool_mtx,
-		    "app_cmd_pool_mtx",	MUTEX_DRIVER,
-		    DDI_INTR_PRI(instance->intr_pri));
+		mutex_init(&instance->app_cmd_pool_mtx, NULL,
+		    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 
-		mutex_init(&instance->config_dev_mtx, "config_dev_mtx",
+		mutex_init(&instance->config_dev_mtx, NULL,
 		    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 
-		mutex_init(&instance->cmd_pend_mtx, "cmd_pend_mtx",
+		mutex_init(&instance->cmd_pend_mtx, NULL,
 		    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 
-		mutex_init(&instance->ocr_flags_mtx, "ocr_flags_mtx",
+		mutex_init(&instance->ocr_flags_mtx, NULL,
 		    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 
-		mutex_init(&instance->int_cmd_mtx, "int_cmd_mtx",
+		mutex_init(&instance->int_cmd_mtx, NULL,
 		    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 		cv_init(&instance->int_cmd_cv, NULL, CV_DRIVER, NULL);
 
-		mutex_init(&instance->cmd_pool_mtx, "cmd_pool_mtx",
+		mutex_init(&instance->cmd_pool_mtx, NULL,
 		    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 
-		mutex_init(&instance->reg_write_mtx, "reg_write_mtx",
+		mutex_init(&instance->reg_write_mtx, NULL,
 		    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 
 		if (instance->tbolt) {
-			mutex_init(&instance->cmd_app_pool_mtx,
-			    "cmd_app_pool_mtx", MUTEX_DRIVER,
-			    DDI_INTR_PRI(instance->intr_pri));
+			mutex_init(&instance->cmd_app_pool_mtx, NULL,
+			    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 
-			mutex_init(&instance->chip_mtx,
-			    "chip_mtx", MUTEX_DRIVER,
-			    DDI_INTR_PRI(instance->intr_pri));
+			mutex_init(&instance->chip_mtx, NULL,
+			    MUTEX_DRIVER, DDI_INTR_PRI(instance->intr_pri));
 
 		}
 
@@ -942,11 +937,6 @@
 		instance->mr_ld_list =
 		    kmem_zalloc(MRDRV_MAX_LD * sizeof (struct mrsas_ld),
 		    KM_SLEEP);
-		if (instance->mr_ld_list == NULL) {
-			cmn_err(CE_WARN, "mr_sas attach(): "
-			    "failed to allocate ld_list array");
-			goto fail_attach;
-		}
 		instance->unroll.ldlist_buff = 1;
 
 #ifdef PDSUPPORT
@@ -1445,12 +1435,7 @@
 
 	ioctl = (struct mrsas_ioctl *)kmem_zalloc(sizeof (struct mrsas_ioctl),
 	    KM_SLEEP);
-	if (ioctl == NULL) {
-		/* Failed to allocate memory for ioctl	*/
-		con_log(CL_ANN, (CE_WARN, "mr_sas_ioctl: "
-		    "failed to allocate memory for ioctl"));
-		return (ENOMEM);
-	}
+	ASSERT(ioctl);
 
 	switch ((uint_t)cmd) {
 		case MRSAS_IOCTL_FIRMWARE:
@@ -1477,9 +1462,6 @@
 
 			break;
 		case MRSAS_IOCTL_AEN:
-			con_log(CL_ANN,
-			    (CE_NOTE, "mrsas_ioctl: IOCTL Register AEN.\n"));
-
 			if (ddi_copyin((void *) arg, &aen,
 			    sizeof (struct mrsas_aen), mode)) {
 				con_log(CL_ANN, (CE_WARN,
@@ -3199,21 +3181,13 @@
 	 * commands.
 	 */
 	instance->cmd_list = kmem_zalloc(sz, KM_SLEEP);
-	if (instance->cmd_list == NULL) {
-		con_log(CL_NONE, (CE_WARN,
-		    "Failed to allocate memory for cmd_list"));
-		return (DDI_FAILURE);
-	}
+	ASSERT(instance->cmd_list);
 
 	/* create a frame pool and assign one frame to each cmd */
 	for (count = 0; count < max_cmd; count++) {
 		instance->cmd_list[count] =
 		    kmem_zalloc(sizeof (struct mrsas_cmd), KM_SLEEP);
-		if (instance->cmd_list[count] == NULL) {
-			con_log(CL_NONE, (CE_WARN,
-			    "Failed to allocate memory for mrsas_cmd"));
-			goto mrsas_undo_cmds;
-		}
+		ASSERT(instance->cmd_list[count]);
 	}
 
 	/* add all the commands to command pool */
@@ -3730,14 +3704,8 @@
 		    PAGESIZE / 512;
 	}
 
-	if (ctrl_info.properties.on_off_properties & DISABLE_OCR_PROP_FLAG) {
+	if (ctrl_info.properties.on_off_properties & DISABLE_OCR_PROP_FLAG)
 		instance->disable_online_ctrl_reset = 1;
-		con_log(CL_ANN1,
-		    (CE_NOTE, "Disable online control Flag is set\n"));
-	} else {
-		con_log(CL_ANN1,
-		    (CE_NOTE, "Disable online control Flag is not set\n"));
-	}
 
 	return (DDI_SUCCESS);
 
@@ -4020,7 +3988,7 @@
 	}
 
 	if (mrsas_check_acc_handle(instance->regmap_handle) != DDI_SUCCESS) {
-		return (ENODEV);
+		return (EIO);
 	}
 
 	return (DDI_SUCCESS);
@@ -4878,7 +4846,6 @@
  * De-allocate the memory and other resources for an dma object, which must
  * have been alloated by a previous call to mrsas_alloc_dma_obj()
  */
-/* ARGSUSED */
 int
 mrsas_free_dma_obj(struct mrsas_instance *instance, dma_obj_t obj)
 {
@@ -5592,7 +5559,7 @@
 				    "copy to user space failed"));
 			}
 			con_log(CL_DLEVEL1, (CE_WARN,
-			    "Copying Sense info sense_buff[%d] = 0x%X\n",
+			    "Copying Sense info sense_buff[%d] = 0x%X",
 			    i, *((uint8_t *)cmd->sense + i)));
 		}
 	}
@@ -5629,8 +5596,8 @@
 	kdcmd = (struct mrsas_dcmd_frame *)&ioctl->frame[0];
 
 	if (instance->adapterresetinprogress) {
-		con_log(CL_ANN1, (CE_WARN, "Reset flag set, "
-		"returning mfi_pkt and setting TRAN_BUSY\n"));
+		con_log(CL_ANN1, (CE_NOTE, "Reset flag set, "
+		"returning mfi_pkt and setting TRAN_BUSY"));
 		return (DDI_FAILURE);
 	}
 	model = ddi_model_convert_from(mode & FMODELS);
@@ -7041,7 +7008,7 @@
 		status = RD_OB_DRWE(instance);
 		if (retry++ == 100) {
 			cmn_err(CE_WARN, "mrsas_reset_ppc: DRWE bit "
-			    "check retry count %d\n", retry);
+			    "check retry count %d", retry);
 			return (DDI_FAILURE);
 		}
 	}
@@ -7053,7 +7020,7 @@
 		status = RD_OB_DRWE(instance);
 		if (retry++ == 100) {
 			cmn_err(CE_WARN, "mrsas_reset_ppc: "
-			    "RESET FAILED. KILL adapter called\n.");
+			    "RESET FAILED. KILL adapter called.");
 
 			(void) mrsas_kill_adapter(instance);
 			return (DDI_FAILURE);
@@ -7380,12 +7347,7 @@
 	instance->intr_htable_size = count * sizeof (ddi_intr_handle_t);
 	instance->intr_htable = kmem_zalloc(instance->intr_htable_size,
 	    KM_SLEEP);
-	if (instance->intr_htable == NULL) {
-		con_log(CL_ANN, (CE_WARN, "mrsas_add_intrs: "
-		    "failed to allocate memory for intr-handle table"));
-		instance->intr_htable_size = 0;
-		return (DDI_FAILURE);
-	}
+	ASSERT(instance->intr_htable);
 
 	flag = ((intr_type == DDI_INTR_TYPE_MSI) ||
 	    (intr_type == DDI_INTR_TYPE_MSIX)) ?
@@ -7684,11 +7646,6 @@
 	}
 
 	sd = kmem_zalloc(sizeof (struct scsi_device), KM_SLEEP);
-	if (sd == NULL) {
-		con_log(CL_ANN1, (CE_WARN, "mrsas_config_ld: "
-		    "failed to allocate mem for scsi_device"));
-		return (NDI_FAILURE);
-	}
 	sd->sd_address.a_hba_tran = instance->tran;
 	sd->sd_address.a_target = (uint16_t)tgt;
 	sd->sd_address.a_lun = (uint8_t)lun;
