aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv
diff options
context:
space:
mode:
authorHaiyang Zhang <haiyangz@microsoft.com>2010-05-19 11:56:28 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-06-30 11:18:15 -0400
commitd750785f305e03669757678c24cb4e6e8761edf0 (patch)
treef38f08861ca00dcc5e2f4177920905f3315b3d02 /drivers/staging/hv
parent8b5d6d3bd3e34e4cc67d875c8c88007c1c9aa960 (diff)
Staging: hv: fix hv_utils module to properly autoload
Added autoloading based on pci id and dmi strings. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv')
-rw-r--r--drivers/staging/hv/hv_utils.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/staging/hv/hv_utils.c b/drivers/staging/hv/hv_utils.c
index 8a49aafea37..2adc9b48ca9 100644
--- a/drivers/staging/hv/hv_utils.c
+++ b/drivers/staging/hv/hv_utils.c
@@ -24,6 +24,8 @@
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/sysctl.h> 25#include <linux/sysctl.h>
26#include <linux/reboot.h> 26#include <linux/reboot.h>
27#include <linux/dmi.h>
28#include <linux/pci.h>
27 29
28#include "logging.h" 30#include "logging.h"
29#include "osd.h" 31#include "osd.h"
@@ -251,10 +253,36 @@ static void heartbeat_onchannelcallback(void *context)
251 DPRINT_EXIT(VMBUS); 253 DPRINT_EXIT(VMBUS);
252} 254}
253 255
256static const struct pci_device_id __initconst
257hv_utils_pci_table[] __maybe_unused = {
258 { PCI_DEVICE(0x1414, 0x5353) }, /* Hyper-V emulated VGA controller */
259 { 0 }
260};
261MODULE_DEVICE_TABLE(pci, hv_utils_pci_table);
262
263
264static const struct dmi_system_id __initconst
265hv_utils_dmi_table[] __maybe_unused = {
266 {
267 .ident = "Hyper-V",
268 .matches = {
269 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
270 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
271 DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
272 },
273 },
274 { },
275};
276MODULE_DEVICE_TABLE(dmi, hv_utils_dmi_table);
277
278
254static int __init init_hyperv_utils(void) 279static int __init init_hyperv_utils(void)
255{ 280{
256 printk(KERN_INFO "Registering HyperV Utility Driver\n"); 281 printk(KERN_INFO "Registering HyperV Utility Driver\n");
257 282
283 if (!dmi_check_system(hv_utils_dmi_table))
284 return -ENODEV;
285
258 hv_cb_utils[HV_SHUTDOWN_MSG].channel->OnChannelCallback = 286 hv_cb_utils[HV_SHUTDOWN_MSG].channel->OnChannelCallback =
259 &shutdown_onchannelcallback; 287 &shutdown_onchannelcallback;
260 hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback; 288 hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback;