Staging: hv: Move probe_failed_work_item from vm_device
authorK. Y. Srinivasan <kys@microsoft.com>
Mon, 7 Mar 2011 21:34:27 +0000 (13:34 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Mar 2011 22:19:29 +0000 (14:19 -0800)
In preparation for consolidating all device related state into
struct hv_device, move probe_failed_work_item from vm_device to
hv_device.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/vmbus.h
drivers/staging/hv/vmbus_api.h
drivers/staging/hv/vmbus_drv.c

index a6be405f1568b0f708971598b916e82175b9f6eb..a12e9e58d32f6cdfeda7d596d43156a53f9ac376 100644 (file)
@@ -30,7 +30,6 @@
 
 
 struct vm_device {
-       struct work_struct probe_failed_work_item;
        struct hv_guid class_id;
        struct hv_guid device_id;
        int probe_error;
index 7f891fb10d3cd05c317bd3d44880f0d67145adee..60e40004e28f404525eb81abe668013c25043837 100644 (file)
@@ -26,6 +26,7 @@
 #define _VMBUS_API_H_
 
 #include <linux/device.h>
+#include <linux/workqueue.h>
 
 #define MAX_PAGE_BUFFER_COUNT                          16
 #define MAX_MULTIPAGE_BUFFER_COUNT                     32 /* 128K */
@@ -117,6 +118,8 @@ struct hv_device {
 
        char name[64];
 
+       struct work_struct probe_failed_work_item;
+
        /* the device type id of this device */
        struct hv_guid dev_type;
 
index 9a9e426f37b9b3ba92bf256d3b93a20791bd521f..36c4ec8c2f83f5385dffa051403f5eafc799ef16 100644 (file)
@@ -904,6 +904,7 @@ static int vmbus_probe(struct device *child_device)
                        drv_to_hv_drv(child_device->driver);
        struct vm_device *device_ctx =
                        device_to_vm_device(child_device);
+       struct hv_device *dev = &device_ctx->device_obj;
 
        /* Let the specific open-source driver handles the probe if it can */
        if (drv->driver.probe) {
@@ -915,9 +916,9 @@ static int vmbus_probe(struct device *child_device)
                                   dev_name(child_device), child_device,
                                   child_device->driver->name, ret);
 
-                       INIT_WORK(&device_ctx->probe_failed_work_item,
+                       INIT_WORK(&dev->probe_failed_work_item,
                                  vmbus_probe_failed_cb);
-                       schedule_work(&device_ctx->probe_failed_work_item);
+                       schedule_work(&dev->probe_failed_work_item);
                }
        } else {
                DPRINT_ERR(VMBUS_DRV, "probe() method not set for driver - %s",