#define PFLG_DISCONNECTED      0       /* PCI device removed */
 #define PFLG_DRIVER_REMOVING   1       /* PCI driver .remove */
 #define PFLG_DRIVER_PROBING    2       /* PCI driver .probe */
-#define PCI_ERR                        30
 
        uint32_t        device_flags;
 #define SWITCH_FOUND           BIT_0
 
        }
 
        /* if PCI error, then avoid mbx processing.*/
-       if (test_bit(PCI_ERR, &base_vha->dpc_flags)) {
+       if (test_bit(PFLG_DISCONNECTED, &base_vha->dpc_flags) &&
+           test_bit(UNLOADING, &base_vha->dpc_flags)) {
                ql_log(ql_log_warn, vha, 0x1191,
                    "PCI error, exiting.\n");
                return QLA_FUNCTION_TIMEOUT;
                                 * then only PCI ERR flag would be set.
                                 * we will do premature exit for above case.
                                 */
-                               if (test_bit(UNLOADING, &base_vha->dpc_flags))
-                                       set_bit(PCI_ERR, &base_vha->dpc_flags);
                                ha->flags.mbox_busy = 0;
                                rval = QLA_FUNCTION_TIMEOUT;
                                goto premature_exit;