Commit 9adcac5c authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: Get rid of struct hv_bus

Now, get rid of struct hv_bus. We will no longer be embedding
struct bus_type.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 66d9229c
...@@ -45,11 +45,6 @@ static struct pci_dev *hv_pci_dev; ...@@ -45,11 +45,6 @@ static struct pci_dev *hv_pci_dev;
static struct tasklet_struct msg_dpc; static struct tasklet_struct msg_dpc;
static struct tasklet_struct event_dpc; static struct tasklet_struct event_dpc;
/* Main vmbus driver data structure */
struct hv_bus {
struct bus_type bus;
};
unsigned int vmbus_loglevel = (ALL_MODULES << 16 | INFO_LVL); unsigned int vmbus_loglevel = (ALL_MODULES << 16 | INFO_LVL);
EXPORT_SYMBOL(vmbus_loglevel); EXPORT_SYMBOL(vmbus_loglevel);
/* (ALL_MODULES << 16 | DEBUG_LVL_ENTEREXIT); */ /* (ALL_MODULES << 16 | DEBUG_LVL_ENTEREXIT); */
...@@ -403,14 +398,14 @@ static void vmbus_device_release(struct device *device) ...@@ -403,14 +398,14 @@ static void vmbus_device_release(struct device *device)
} }
/* The one and only one */ /* The one and only one */
static struct hv_bus hv_bus = { static struct bus_type hv_bus = {
.bus.name = "vmbus", .name = "vmbus",
.bus.match = vmbus_match, .match = vmbus_match,
.bus.shutdown = vmbus_shutdown, .shutdown = vmbus_shutdown,
.bus.remove = vmbus_remove, .remove = vmbus_remove,
.bus.probe = vmbus_probe, .probe = vmbus_probe,
.bus.uevent = vmbus_uevent, .uevent = vmbus_uevent,
.bus.dev_attrs = vmbus_device_attrs, .dev_attrs = vmbus_device_attrs,
}; };
static const char *driver_name = "hyperv"; static const char *driver_name = "hyperv";
...@@ -548,14 +543,12 @@ static int vmbus_bus_init(struct pci_dev *pdev) ...@@ -548,14 +543,12 @@ static int vmbus_bus_init(struct pci_dev *pdev)
goto cleanup; goto cleanup;
} }
hv_bus.bus.name = driver_name;
/* Initialize the bus context */ /* Initialize the bus context */
tasklet_init(&msg_dpc, vmbus_on_msg_dpc, 0); tasklet_init(&msg_dpc, vmbus_on_msg_dpc, 0);
tasklet_init(&event_dpc, vmbus_on_event, 0); tasklet_init(&event_dpc, vmbus_on_event, 0);
/* Now, register the bus with LDM */ /* Now, register the bus with LDM */
ret = bus_register(&hv_bus.bus); ret = bus_register(&hv_bus);
if (ret) { if (ret) {
ret = -1; ret = -1;
goto cleanup; goto cleanup;
...@@ -570,7 +563,7 @@ static int vmbus_bus_init(struct pci_dev *pdev) ...@@ -570,7 +563,7 @@ static int vmbus_bus_init(struct pci_dev *pdev)
pr_err("Unable to request IRQ %d\n", pr_err("Unable to request IRQ %d\n",
pdev->irq); pdev->irq);
bus_unregister(&hv_bus.bus); bus_unregister(&hv_bus);
ret = -1; ret = -1;
goto cleanup; goto cleanup;
...@@ -586,7 +579,7 @@ static int vmbus_bus_init(struct pci_dev *pdev) ...@@ -586,7 +579,7 @@ static int vmbus_bus_init(struct pci_dev *pdev)
ret = vmbus_connect(); ret = vmbus_connect();
if (ret) { if (ret) {
free_irq(pdev->irq, pdev); free_irq(pdev->irq, pdev);
bus_unregister(&hv_bus.bus); bus_unregister(&hv_bus);
goto cleanup; goto cleanup;
} }
...@@ -616,7 +609,7 @@ int vmbus_child_driver_register(struct device_driver *drv) ...@@ -616,7 +609,7 @@ int vmbus_child_driver_register(struct device_driver *drv)
pr_info("child driver registering - name %s\n", drv->name); pr_info("child driver registering - name %s\n", drv->name);
/* The child driver on this vmbus */ /* The child driver on this vmbus */
drv->bus = &hv_bus.bus; drv->bus = &hv_bus;
ret = driver_register(drv); ret = driver_register(drv);
...@@ -686,7 +679,7 @@ int vmbus_child_device_register(struct hv_device *child_device_obj) ...@@ -686,7 +679,7 @@ int vmbus_child_device_register(struct hv_device *child_device_obj)
atomic_inc_return(&device_num)); atomic_inc_return(&device_num));
/* The new device belongs to this bus */ /* The new device belongs to this bus */
child_device_obj->device.bus = &hv_bus.bus; /* device->dev.bus; */ child_device_obj->device.bus = &hv_bus; /* device->dev.bus; */
child_device_obj->device.parent = &hv_pci_dev->dev; child_device_obj->device.parent = &hv_pci_dev->dev;
child_device_obj->device.release = vmbus_device_release; child_device_obj->device.release = vmbus_device_release;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment