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/hyperv.h | |
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/hyperv.h')
-rw-r--r-- | drivers/staging/hv/hyperv.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h index d96de668eb13..c24981198b1b 100644 --- a/drivers/staging/hv/hyperv.h +++ b/drivers/staging/hv/hyperv.h @@ -845,8 +845,12 @@ static inline struct hv_driver *drv_to_hv_drv(struct device_driver *d) /* Vmbus interface */ -int vmbus_child_driver_register(struct device_driver *drv); -void vmbus_child_driver_unregister(struct device_driver *drv); +#define vmbus_driver_register(driver) \ + __vmbus_driver_register(driver, THIS_MODULE, KBUILD_MODNAME) +int __must_check __vmbus_driver_register(struct hv_driver *hv_driver, + struct module *owner, + const char *mod_name); +void vmbus_driver_unregister(struct hv_driver *hv_driver); /** * VMBUS_DEVICE - macro used to describe a specific hyperv vmbus device |