summaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv/hv_util.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2011-08-26 00:07:32 +0200
committerGreg Kroah-Hartman2011-08-26 00:07:32 +0200
commit768fa21919b7f30b77f0b3ba94939f5556d111d5 (patch)
treef1f1a8f6f7b49d69f6b52dbcf4a540b4db0ab9f1 /drivers/staging/hv/hv_util.c
parentStaging: hv: util: Get rid of the PCI signature in hv_util.c (diff)
downloadkernel-qcow2-linux-768fa21919b7f30b77f0b3ba94939f5556d111d5.tar.gz
kernel-qcow2-linux-768fa21919b7f30b77f0b3ba94939f5556d111d5.tar.xz
kernel-qcow2-linux-768fa21919b7f30b77f0b3ba94939f5556d111d5.zip
Staging: hv: fix up driver registering mess
Individual drivers should never be touching the 'struct device' field, so if that is a requirement to pass to the vmbus core, you know something is wrong. This patch fixes that all up, and resolves the problem where the module reference counting was not happening properly for the individual drivers as well. Overall, it reduces the lines of code the individual drivers have to have, which tells you that this is the correct thing to do. Also, somehow the _GPL marking for the functions got removed on an older patch. As the name of the function was changing, properly change the _GPL marking as well at the same time. 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>
Diffstat (limited to 'drivers/staging/hv/hv_util.c')
-rw-r--r--drivers/staging/hv/hv_util.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index b0d89deec765..f2f456f5e444 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -34,8 +34,6 @@ static u8 *shut_txf_buf;
static u8 *time_txf_buf;
static u8 *hbeat_txf_buf;
-static const char *driver_name = "hv_util";
-
static void shutdown_onchannelcallback(void *context)
{
struct vmbus_channel *channel = context;
@@ -244,6 +242,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
/* The one and only one */
static struct hv_driver util_drv = {
+ .name = "hv_util",
.id_table = id_table,
.probe = util_probe,
.remove = util_remove,
@@ -277,9 +276,7 @@ static int __init init_hyperv_utils(void)
hv_cb_utils[HV_KVP_MSG].callback = &hv_kvp_onchannelcallback;
- util_drv.driver.name = driver_name;
-
- return vmbus_child_driver_register(&util_drv.driver);
+ return vmbus_driver_register(&util_drv);
}
static void exit_hyperv_utils(void)
@@ -311,7 +308,7 @@ static void exit_hyperv_utils(void)
kfree(shut_txf_buf);
kfree(time_txf_buf);
kfree(hbeat_txf_buf);
- vmbus_child_driver_unregister(&util_drv.driver);
+ vmbus_driver_unregister(&util_drv);
}
module_init(init_hyperv_utils);