virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@suse.de, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org, virtualization@lists.osdl.org
Cc: Haiyang Zhang <haiyangz@microsoft.com>,
	Abhishek Kane <v-abkane@microsoft.com>
Subject: [PATCH 10/18] Staging: hv: Get rid of struct hv_bus
Date: Fri, 29 Apr 2011 13:45:08 -0700	[thread overview]
Message-ID: <1304109916-24874-10-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1304109916-24874-1-git-send-email-kys@microsoft.com>

Now, get rid of struct hv_bus. We will no longer be embedding
struct bus_type.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
 drivers/staging/hv/vmbus_drv.c |   33 +++++++++++++--------------------
 1 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 6cc01c2..872752a 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -45,11 +45,6 @@ static struct pci_dev *hv_pci_dev;
 static struct tasklet_struct msg_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);
 EXPORT_SYMBOL(vmbus_loglevel);
 	/* (ALL_MODULES << 16 | DEBUG_LVL_ENTEREXIT); */
@@ -403,14 +398,14 @@ static void vmbus_device_release(struct device *device)
 }
 
 /* The one and only one */
-static struct hv_bus  hv_bus = {
-	.bus.name =		"vmbus",
-	.bus.match =		vmbus_match,
-	.bus.shutdown =		vmbus_shutdown,
-	.bus.remove =		vmbus_remove,
-	.bus.probe =		vmbus_probe,
-	.bus.uevent =		vmbus_uevent,
-	.bus.dev_attrs =	vmbus_device_attrs,
+static struct bus_type  hv_bus = {
+	.name =		"vmbus",
+	.match =		vmbus_match,
+	.shutdown =		vmbus_shutdown,
+	.remove =		vmbus_remove,
+	.probe =		vmbus_probe,
+	.uevent =		vmbus_uevent,
+	.dev_attrs =	vmbus_device_attrs,
 };
 
 static const char *driver_name = "hyperv";
@@ -548,14 +543,12 @@ static int vmbus_bus_init(struct pci_dev *pdev)
 		goto cleanup;
 	}
 
-	hv_bus.bus.name = driver_name;
-
 	/* Initialize the bus context */
 	tasklet_init(&msg_dpc, vmbus_on_msg_dpc, 0);
 	tasklet_init(&event_dpc, vmbus_on_event, 0);
 
 	/* Now, register the bus  with LDM */
-	ret = bus_register(&hv_bus.bus);
+	ret = bus_register(&hv_bus);
 	if (ret) {
 		ret = -1;
 		goto cleanup;
@@ -570,7 +563,7 @@ static int vmbus_bus_init(struct pci_dev *pdev)
 		pr_err("Unable to request IRQ %d\n",
 			   pdev->irq);
 
-		bus_unregister(&hv_bus.bus);
+		bus_unregister(&hv_bus);
 
 		ret = -1;
 		goto cleanup;
@@ -586,7 +579,7 @@ static int vmbus_bus_init(struct pci_dev *pdev)
 	ret = vmbus_connect();
 	if (ret) {
 		free_irq(pdev->irq, pdev);
-		bus_unregister(&hv_bus.bus);
+		bus_unregister(&hv_bus);
 		goto cleanup;
 	}
 
@@ -616,7 +609,7 @@ int vmbus_child_driver_register(struct device_driver *drv)
 	pr_info("child driver registering - name %s\n", drv->name);
 
 	/* The child driver on this vmbus */
-	drv->bus = &hv_bus.bus;
+	drv->bus = &hv_bus;
 
 	ret = driver_register(drv);
 
@@ -686,7 +679,7 @@ int vmbus_child_device_register(struct hv_device *child_device_obj)
 		     atomic_inc_return(&device_num));
 
 	/* 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.release = vmbus_device_release;
 
-- 
1.7.4.1

  parent reply	other threads:[~2011-04-29 20:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29 20:42 [RESEND] [PATCH 00/18] Staging: hv: Cleanup vmbus driver code K. Y. Srinivasan
2011-04-29 20:44 ` [PATCH 01/18] Staging: hv: vmbus_driver cannot be unloaded; cleanup accordingly K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 02/18] Staging: hv: Get rid of vmbus_release_unattached_channels() as it is not used K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 03/18] Staging: hv: Get rid of the drv field in struct hv_device K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 04/18] Staging: hv: Cleanup error handling in vmbus_child_device_register() K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 05/18] Staging: hv: Cleanup vmbus_probe() function K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 06/18] Staging: hv: Properly handle errors in hv_pci_probe() K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 07/18] Staging: hv: Make hv_pci_dev a static variable K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 08/18] Staging: hv: Make msg_dpc a stand alone variable K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 09/18] Staging: hv: Make event_dpc " K. Y. Srinivasan
2011-04-29 20:45   ` K. Y. Srinivasan [this message]
2011-04-29 20:45   ` [PATCH 11/18] Staging: hv: Add probe function to struct hv_driver K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 12/18] Staging: hv: Use the probe function in " K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 13/18] Staging: hv: Add remove() function to " K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 14/18] Staging: hv: Use the remove() function in " K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 15/18] Staging: hv: Add shutdown() function to " K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 16/18] Staging: hv: Use the shutdown() function in " K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 17/18] Staging: hv: VMBUS is a acpi enumerated device; get irq value from bios K. Y. Srinivasan
2011-04-29 20:45   ` [PATCH 18/18] Staging: hv: Get rid of an unused variable from struct hv_driver K. Y. Srinivasan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304109916-24874-10-git-send-email-kys@microsoft.com \
    --to=kys@microsoft.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=haiyangz@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=v-abkane@microsoft.com \
    --cc=virtualization@lists.osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).