diff options
author | Greg Kroah-Hartman | 2011-08-26 00:07:32 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2011-08-26 00:07:32 +0200 |
commit | 768fa21919b7f30b77f0b3ba94939f5556d111d5 (patch) | |
tree | f1f1a8f6f7b49d69f6b52dbcf4a540b4db0ab9f1 /drivers/staging/hv/netvsc_drv.c | |
parent | Staging: hv: util: Get rid of the PCI signature in hv_util.c (diff) | |
download | kernel-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/netvsc_drv.c')
-rw-r--r-- | drivers/staging/hv/netvsc_drv.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c index 2d2955c1925f..ad1ef038ff7f 100644 --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c @@ -422,6 +422,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table); /* The one and only one */ static struct hv_driver netvsc_drv = { + .name = "netvsc", .id_table = id_table, .probe = netvsc_probe, .remove = netvsc_remove, @@ -429,26 +430,12 @@ static struct hv_driver netvsc_drv = { static void __exit netvsc_drv_exit(void) { - vmbus_child_driver_unregister(&netvsc_drv.driver); + vmbus_driver_unregister(&netvsc_drv); } - static int __init netvsc_drv_init(void) { - struct hv_driver *drv = &netvsc_drv; - int ret; - - pr_info("initializing...."); - - /* Callback to client driver to complete the initialization */ - netvsc_initialize(drv); - - drv->driver.name = drv->name; - - /* The driver belongs to vmbus */ - ret = vmbus_child_driver_register(&drv->driver); - - return ret; + return vmbus_driver_register(&netvsc_drv); } MODULE_LICENSE("GPL"); |