Merge branch 'fbdev-next' of git://github.com/schandinat/linux-2.6
[firefly-linux-kernel-4.4.55.git] / drivers / staging / mei / init.c
index 0fa8216fd0eb09d48dd0f4b9d8165a9954beef9d..8bf34794489c51af1a281d2ca3650d9706f8f48f 100644 (file)
@@ -133,6 +133,7 @@ struct mei_device *mei_device_init(struct pci_dev *pdev)
        init_waitqueue_head(&dev->wait_stop_wd);
        dev->mei_state = MEI_INITIALIZING;
        dev->iamthif_state = MEI_IAMTHIF_IDLE;
+       dev->wd_interface_reg = false;
 
 
        mei_io_list_init(&dev->read_list);
@@ -469,9 +470,12 @@ void mei_allocate_me_clients_storage(struct mei_device *dev)
  *
  * @dev: the device structure
  *
- * returns none.
+ * returns:
+ *     < 0 - Error.
+ *  = 0 - no more clients.
+ *  = 1 - still have clients to send properties request.
  */
-void mei_host_client_properties(struct mei_device *dev)
+int mei_host_client_properties(struct mei_device *dev)
 {
        struct mei_msg_hdr *mei_header;
        struct hbm_props_request *host_cli_req;
@@ -503,26 +507,15 @@ void mei_host_client_properties(struct mei_device *dev)
                        dev->mei_state = MEI_RESETING;
                        dev_dbg(&dev->pdev->dev, "write send enumeration request message to FW fail.\n");
                        mei_reset(dev, 1);
-                       return;
+                       return -EIO;
                }
 
                dev->init_clients_timer = INIT_CLIENTS_TIMEOUT;
                dev->me_client_index = b;
-               return;
+               return 1;
        }
 
-
-       /*
-        * Clear Map for indicating now ME clients
-        * with associated host client
-        */
-       bitmap_zero(dev->host_clients_map, MEI_CLIENTS_MAX);
-       dev->open_handle_count = 0;
-       bitmap_set(dev->host_clients_map, 0, 3);
-       dev->mei_state = MEI_ENABLED;
-
-       mei_wd_host_init(dev);
-       return;
+       return 0;
 }
 
 /**