Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249351
b: refs/heads/master
c: 71a6655
h: refs/heads/master
i:
  249349: aab8356
  249347: 1048a78
  249343: bd5b9c4
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed May 3, 2011
1 parent 58ad99c commit 9c23883
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b14a7b3014b1151597d526f2e24f291ebc3a4f5b
refs/heads/master: 71a6655dedc2d8be8a292fc96840924d846ab925
34 changes: 25 additions & 9 deletions trunk/drivers/staging/hv/vmbus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ EXPORT_SYMBOL(vmbus_loglevel);
/* (ALL_MODULES << 16 | DEBUG_LVL_ENTEREXIT); */
/* (((VMBUS | VMBUS_DRV)<<16) | DEBUG_LVL_ENTEREXIT); */

static int pci_probe_error;
static struct completion probe_event;

static void get_channel_info(struct hv_device *device,
struct hv_device_info *info)
Expand Down Expand Up @@ -722,19 +724,19 @@ void vmbus_child_device_unregister(struct hv_device *device_obj)
static int __devinit hv_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
int err;

hv_pci_dev = pdev;

err = pci_enable_device(pdev);
if (err)
return err;
pci_probe_error = pci_enable_device(pdev);
if (pci_probe_error)
goto probe_cleanup;

err = vmbus_bus_init(pdev);
if (err)
pci_probe_error = vmbus_bus_init(pdev);
if (pci_probe_error)
pci_disable_device(pdev);

return err;
probe_cleanup:
complete(&probe_event);
return pci_probe_error;
}

/*
Expand All @@ -757,7 +759,21 @@ static struct pci_driver hv_bus_driver = {

static int __init hv_pci_init(void)
{
return pci_register_driver(&hv_bus_driver);
int ret;
init_completion(&probe_event);
ret = pci_register_driver(&hv_bus_driver);
if (ret)
return ret;
/*
* All the vmbus initialization occurs within the
* hv_pci_probe() function. Wait for hv_pci_probe()
* to complete.
*/
wait_for_completion(&probe_event);

if (pci_probe_error)
pci_unregister_driver(&hv_bus_driver);
return pci_probe_error;
}


Expand Down

0 comments on commit 9c23883

Please sign in to comment.