Print this page
9702 HBA drivers don't need the redundant devfs_clean step
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>

@@ -42,11 +42,11 @@
  */
 
 /*
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2018 Nexenta Systems, Inc.
  * Copyright 2015, 2017 Citrus IT Limited. All rights reserved.
  * Copyright 2015 Garrett D'Amore <garrett@damore.org>
  */
 
 #include <sys/types.h>

@@ -68,11 +68,10 @@
 #include <sys/sunddi.h>
 #include <sys/atomic.h>
 #include <sys/signal.h>
 #include <sys/byteorder.h>
 #include <sys/sdt.h>
-#include <sys/fs/dv_node.h>     /* devfs_clean */
 
 #include "mr_sas.h"
 
 /*
  * FMA header files

@@ -7740,13 +7739,12 @@
 
 static void
 mrsas_issue_evt_taskq(struct mrsas_eventinfo *mrevt)
 {
         struct mrsas_instance *instance = mrevt->instance;
-        dev_info_t *dip, *pdip;
+        dev_info_t *dip;
         int circ1 = 0;
-        char *devname;
 
         con_log(CL_ANN1, (CE_NOTE, "mrsas_issue_evt_taskq: called for"
             " tgt %d lun %d event %d",
             mrevt->tgt, mrevt->lun, mrevt->event));
 

@@ -7763,11 +7761,10 @@
 
         ndi_devi_enter(instance->dip, &circ1);
         switch (mrevt->event) {
         case MRSAS_EVT_CONFIG_TGT:
                 if (dip == NULL) {
-
                         if (mrevt->lun == 0) {
                                 (void) mrsas_config_ld(instance, mrevt->tgt,
                                     0, NULL);
                         } else if (instance->tbolt || instance->skinny) {
                                 (void) mrsas_tbolt_config_pd(instance,

@@ -7776,32 +7773,21 @@
                         }
                         con_log(CL_ANN1, (CE_NOTE,
                             "mr_sas: EVT_CONFIG_TGT called:"
                             " for tgt %d lun %d event %d",
                             mrevt->tgt, mrevt->lun, mrevt->event));
-
                 } else {
                         con_log(CL_ANN1, (CE_NOTE,
                             "mr_sas: EVT_CONFIG_TGT dip != NULL:"
                             " for tgt %d lun %d event %d",
                             mrevt->tgt, mrevt->lun, mrevt->event));
                 }
                 break;
         case MRSAS_EVT_UNCONFIG_TGT:
                 if (dip) {
-                        if (i_ddi_devi_attached(dip)) {
-
-                                pdip = ddi_get_parent(dip);
-
-                                devname = kmem_zalloc(MAXNAMELEN + 1, KM_SLEEP);
-                                (void) ddi_deviname(dip, devname);
-
-                                (void) devfs_clean(pdip, devname + 1,
-                                    DV_CLEAN_FORCE);
-                                kmem_free(devname, MAXNAMELEN + 1);
-                        }
-                        (void) ndi_devi_offline(dip, NDI_DEVI_REMOVE);
+                        (void) ndi_devi_offline(dip,
+                            NDI_DEVFS_CLEAN | NDI_DEVI_REMOVE);
                         con_log(CL_ANN1, (CE_NOTE,
                             "mr_sas: EVT_UNCONFIG_TGT called:"
                             " for tgt %d lun %d event %d",
                             mrevt->tgt, mrevt->lun, mrevt->event));
                 } else {