Staging: hv: hv_mouse: remove a forward declaration
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 25 Aug 2011 23:47:43 +0000 (16:47 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 25 Aug 2011 23:47:43 +0000 (16:47 -0700)
This moves some functions around to remove a forward declaration.

Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/hv_mouse.c

index 257684eff6e62085d3f3c6cc9d8dc8fe21c0f7c9..083f28f7abdd79e8517b0de4219beaf788969814 100644 (file)
@@ -180,8 +180,6 @@ struct input_device_context {
        int                     connected;
 };
 
-static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len);
-
 static struct mousevsc_dev *alloc_input_device(struct hv_device *device)
 {
        struct mousevsc_dev *input_dev;
@@ -651,6 +649,68 @@ cleanup:
        return ret;
 }
 
+static int mousevsc_hid_open(struct hid_device *hid)
+{
+       return 0;
+}
+
+static void mousevsc_hid_close(struct hid_device *hid)
+{
+}
+
+static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
+{
+       struct input_device_context *input_device_ctx =
+               dev_get_drvdata(&dev->device);
+       struct hid_device *hid_dev;
+
+       /* hid_debug = -1; */
+       hid_dev = kmalloc(sizeof(struct hid_device), GFP_KERNEL);
+
+       if (hid_parse_report(hid_dev, packet, len)) {
+               DPRINT_INFO(INPUTVSC_DRV, "Unable to call hd_parse_report");
+               return;
+       }
+
+       if (hid_dev) {
+               DPRINT_INFO(INPUTVSC_DRV, "hid_device created");
+
+               hid_dev->ll_driver->open  = mousevsc_hid_open;
+               hid_dev->ll_driver->close = mousevsc_hid_close;
+
+               hid_dev->bus = BUS_VIRTUAL;
+               hid_dev->vendor = input_device_ctx->device_info.vendor;
+               hid_dev->product = input_device_ctx->device_info.product;
+               hid_dev->version = input_device_ctx->device_info.version;
+               hid_dev->dev = dev->device;
+
+               sprintf(hid_dev->name, "%s",
+                       input_device_ctx->device_info.name);
+
+               /*
+                * HJ Do we want to call it with a 0
+                */
+               if (!hidinput_connect(hid_dev, 0)) {
+                       hid_dev->claimed |= HID_CLAIMED_INPUT;
+
+                       input_device_ctx->connected = 1;
+
+                       DPRINT_INFO(INPUTVSC_DRV,
+                                    "HID device claimed by input\n");
+               }
+
+               if (!hid_dev->claimed) {
+                       DPRINT_ERR(INPUTVSC_DRV,
+                                   "HID device not claimed by "
+                                   "input or hiddev\n");
+               }
+
+               input_device_ctx->hid_device = hid_dev;
+       }
+
+       kfree(hid_dev);
+}
+
 static int mousevsc_on_device_add(struct hv_device *device,
                                        void *additional_info)
 {
@@ -762,15 +822,6 @@ static int mousevsc_on_device_remove(struct hv_device *device)
 }
 
 
-static int mousevsc_hid_open(struct hid_device *hid)
-{
-       return 0;
-}
-
-static void mousevsc_hid_close(struct hid_device *hid)
-{
-}
-
 static int mousevsc_probe(struct hv_device *dev)
 {
        int ret = 0;
@@ -826,59 +877,6 @@ static int mousevsc_remove(struct hv_device *dev)
        return ret;
 }
 
-static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
-{
-       struct input_device_context *input_device_ctx =
-               dev_get_drvdata(&dev->device);
-       struct hid_device *hid_dev;
-
-       /* hid_debug = -1; */
-       hid_dev = kmalloc(sizeof(struct hid_device), GFP_KERNEL);
-
-       if (hid_parse_report(hid_dev, packet, len)) {
-               DPRINT_INFO(INPUTVSC_DRV, "Unable to call hd_parse_report");
-               return;
-       }
-
-       if (hid_dev) {
-               DPRINT_INFO(INPUTVSC_DRV, "hid_device created");
-
-               hid_dev->ll_driver->open  = mousevsc_hid_open;
-               hid_dev->ll_driver->close = mousevsc_hid_close;
-
-               hid_dev->bus = BUS_VIRTUAL;
-               hid_dev->vendor = input_device_ctx->device_info.vendor;
-               hid_dev->product = input_device_ctx->device_info.product;
-               hid_dev->version = input_device_ctx->device_info.version;
-               hid_dev->dev = dev->device;
-
-               sprintf(hid_dev->name, "%s",
-                       input_device_ctx->device_info.name);
-
-               /*
-                * HJ Do we want to call it with a 0
-                */
-               if (!hidinput_connect(hid_dev, 0)) {
-                       hid_dev->claimed |= HID_CLAIMED_INPUT;
-
-                       input_device_ctx->connected = 1;
-
-                       DPRINT_INFO(INPUTVSC_DRV,
-                                    "HID device claimed by input\n");
-               }
-
-               if (!hid_dev->claimed) {
-                       DPRINT_ERR(INPUTVSC_DRV,
-                                   "HID device not claimed by "
-                                   "input or hiddev\n");
-               }
-
-               input_device_ctx->hid_device = hid_dev;
-       }
-
-       kfree(hid_dev);
-}
-
 static const struct hv_vmbus_device_id id_table[] = {
        /* Mouse guid */
        { VMBUS_DEVICE(0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,