Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280055
b: refs/heads/master
c: cf6a2ea
h: refs/heads/master
i:
  280053: 9353d03
  280051: 4871beb
  280047: 58f4aba
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Dec 10, 2011
1 parent 2c1e6f5 commit dab8852
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2554f50df9be3c53a13f7541a5f4d054bd56cc3
refs/heads/master: cf6a2eacbcb2593b5b91d0817915c4f0464bb534
16 changes: 16 additions & 0 deletions trunk/drivers/hv/vmbus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ struct hv_device_info {
struct hv_dev_port_info outbound;
};

static int vmbus_exists(void)
{
if (hv_acpi_dev == NULL)
return -ENODEV;

return 0;
}


static void get_channel_info(struct hv_device *device,
struct hv_device_info *info)
Expand Down Expand Up @@ -590,6 +598,10 @@ int __vmbus_driver_register(struct hv_driver *hv_driver, struct module *owner, c

pr_info("registering driver %s\n", hv_driver->name);

ret = vmbus_exists();
if (ret < 0)
return ret;

hv_driver->driver.name = hv_driver->name;
hv_driver->driver.owner = owner;
hv_driver->driver.mod_name = mod_name;
Expand All @@ -614,6 +626,9 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver)
{
pr_info("unregistering driver %s\n", hv_driver->name);

if (!vmbus_exists())
return;

driver_unregister(&hv_driver->driver);

}
Expand Down Expand Up @@ -776,6 +791,7 @@ static int __init hv_acpi_init(void)

cleanup:
acpi_bus_unregister_driver(&vmbus_acpi_driver);
hv_acpi_dev = NULL;
return ret;
}

Expand Down

0 comments on commit dab8852

Please sign in to comment.