Staging: hv: vmbus: Cleanup error codes in connection.c
authorK. Y. Srinivasan <kys@microsoft.com>
Mon, 6 Jun 2011 22:50:10 +0000 (15:50 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 7 Jun 2011 20:46:06 +0000 (13:46 -0700)
Cleanup error codes in connection.c.

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

index 7d7f1d5d5a3d82cf86867eb5d3a69bf26ba9d67e..7e15392fac9ed7167d6cece8c19d92910a058e2e 100644 (file)
@@ -51,13 +51,13 @@ int vmbus_connect(void)
 
        /* Make sure we are not connecting or connected */
        if (vmbus_connection.conn_state != DISCONNECTED)
-               return -1;
+               return -EISCONN;
 
        /* Initialize the vmbus connection */
        vmbus_connection.conn_state = CONNECTING;
        vmbus_connection.work_queue = create_workqueue("hv_vmbus_con");
        if (!vmbus_connection.work_queue) {
-               ret = -1;
+               ret = -ENOMEM;
                goto cleanup;
        }
 
@@ -74,7 +74,7 @@ int vmbus_connect(void)
        vmbus_connection.int_page =
        (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, 0);
        if (vmbus_connection.int_page == NULL) {
-               ret = -1;
+               ret = -ENOMEM;
                goto cleanup;
        }
 
@@ -90,7 +90,7 @@ int vmbus_connect(void)
        vmbus_connection.monitor_pages =
        (void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 1);
        if (vmbus_connection.monitor_pages == NULL) {
-               ret = -1;
+               ret = -ENOMEM;
                goto cleanup;
        }
 
@@ -157,7 +157,7 @@ int vmbus_connect(void)
                pr_err("Unable to connect, "
                        "Version %d not supported by Hyper-V\n",
                        VMBUS_REVISION_NUMBER);
-               ret = -1;
+               ret = -ECONNREFUSED;
                goto cleanup;
        }