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>
Subject: [PATCH 07/25] Staging: hv: vmbus: Change the signature of struct hv_driver remove() function
Date: Thu, 8 Sep 2011 07:24:18 -0700 [thread overview]
Message-ID: <1315491876-9554-7-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1315491876-9554-1-git-send-email-kys@microsoft.com>
In preparation for leveraging the driver_data in struct
hv_vmbus_device_id, change the signature of struct hv_driver remove() function.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/hv_mouse.c | 3 ++-
drivers/staging/hv/hv_util.c | 3 ++-
drivers/staging/hv/hyperv.h | 2 +-
drivers/staging/hv/netvsc_drv.c | 3 ++-
drivers/staging/hv/storvsc_drv.c | 3 ++-
drivers/staging/hv/vmbus_drv.c | 9 ++++++++-
6 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index 5ff8a03..d60f287 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -847,7 +847,8 @@ static int mousevsc_probe(struct hv_device *dev,
return 0;
}
-static int mousevsc_remove(struct hv_device *dev)
+static int mousevsc_remove(struct hv_device *dev,
+ const struct hv_vmbus_device_id *dev_id)
{
struct input_device_context *input_dev_ctx;
int ret;
diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index d9460fdd..661631d 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -245,7 +245,8 @@ static int util_probe(struct hv_device *dev,
return 0;
}
-static int util_remove(struct hv_device *dev)
+static int util_remove(struct hv_device *dev,
+ const struct hv_vmbus_device_id *dev_id)
{
return 0;
}
diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h
index caa3a7b..cf02ae1 100644
--- a/drivers/staging/hv/hyperv.h
+++ b/drivers/staging/hv/hyperv.h
@@ -811,7 +811,7 @@ struct hv_driver {
struct device_driver driver;
int (*probe)(struct hv_device *, const struct hv_vmbus_device_id *);
- int (*remove)(struct hv_device *);
+ int (*remove)(struct hv_device *, const struct hv_vmbus_device_id *);
void (*shutdown)(struct hv_device *);
};
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index d06cde2..d0189a3 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -384,7 +384,8 @@ out:
return ret;
}
-static int netvsc_remove(struct hv_device *dev)
+static int netvsc_remove(struct hv_device *dev,
+ const struct hv_vmbus_device_id *dev_id)
{
struct net_device *net = dev_get_drvdata(&dev->device);
struct net_device_context *ndev_ctx;
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index e2c63e5..e5da758 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -1021,7 +1021,8 @@ static unsigned int copy_to_bounce_buffer(struct scatterlist *orig_sgl,
}
-static int storvsc_remove(struct hv_device *dev)
+static int storvsc_remove(struct hv_device *dev,
+ const struct hv_vmbus_device_id *dev_id)
{
struct Scsi_Host *host = dev_get_drvdata(&dev->device);
struct hv_host_device *host_dev =
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index c7df7f4..b9aeb76 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -329,12 +329,19 @@ static int vmbus_remove(struct device *child_device)
struct hv_driver *drv;
struct hv_device *dev = device_to_hv_device(child_device);
+ const struct hv_vmbus_device_id *dev_id;
if (child_device->driver) {
drv = drv_to_hv_drv(child_device->driver);
+ dev_id = drv->id_table;
+
+ for (; !is_null_guid(dev_id->guid); dev_id++)
+ if (!memcmp(&dev_id->guid, &dev->dev_type.b,
+ sizeof(uuid_le)))
+ break;
if (drv->remove) {
- ret = drv->remove(dev);
+ ret = drv->remove(dev, dev_id);
} else {
pr_err("remove not set for driver %s\n",
dev_name(child_device));
--
1.7.4.1
next prev parent reply other threads:[~2011-09-08 14:24 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-08 14:24 [PATCH 0000/0025] Staging: hv: Driver cleanup K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 01/25] Staging: hv: vmbus: Rename vmbus_child_device_create K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 02/25] Staging: hv: vmbus: Rename vmbus_child_device_register K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 03/25] Staging: hv: vmbus: Rename vmbus_child_device_unregister K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 04/25] Staging: hv: vmbus: Cleanup dated comments in channel_mgmt.c K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 05/25] Staging: hv: vmbus: Change the signature of struct hv_driver probe function K. Y. Srinivasan
2011-09-09 20:38 ` Greg KH
2011-09-08 14:24 ` [PATCH 06/25] Staging: hv: storvsc: Use the driver_data to identify ide K. Y. Srinivasan
2011-09-09 20:41 ` Greg KH
2011-09-08 14:24 ` K. Y. Srinivasan [this message]
2011-09-09 20:40 ` [PATCH 07/25] Staging: hv: vmbus: Change the signature of struct hv_driver remove() function Greg KH
2011-09-08 14:24 ` [PATCH 08/25] Staging: hv: util: Perform some service specific initialization in util_probe() K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 09/25] Staging: hv: util: Perform some service specific de-initialization in util_remove() K. Y. Srinivasan
2011-09-09 20:42 ` Greg KH
2011-09-10 14:31 ` KY Srinivasan
2011-09-10 18:35 ` Greg KH
2011-09-08 14:24 ` [PATCH 10/25] Staging: hv: vmbus: Return proper error code in vmbus_remove() K. Y. Srinivasan
2011-09-09 20:43 ` Greg KH
2011-09-10 14:22 ` KY Srinivasan
2011-09-10 18:33 ` Greg KH
2011-09-10 20:33 ` KY Srinivasan
2011-09-08 14:24 ` [PATCH 11/25] Staging: hv: util: Properly handle util services in the util driver K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 12/25] Staging: hv: vmbus: Get rid of hv_cb_utils[] and other unneeded code K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 13/25] Staging: hv: vmbus: Get rid of the module dependency K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 14/25] Staging: hv: vmbus: Introduce functions for setting and getting driver data K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 15/25] Staging: hv: storvsc: Get rid of storvsc_dev_add() by inlining the code K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 16/25] Staging: hv: storvsc: Get rid of alloc_stor_device() " K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 17/25] Staging: hv: storvsc: Get rid of some unnecessary state and definitions K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 18/25] Staging: hv: storvsc: Eliminate the usage of ext field in struct hv_device K. Y. Srinivasan
2011-09-09 20:44 ` Greg KH
2011-09-10 14:16 ` KY Srinivasan
2011-09-10 18:28 ` Greg KH
2011-09-08 14:24 ` [PATCH 19/25] Staging: hv: netvsc: Get rid of the usage of the " K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 20/25] Staging: hv: mousevsc: " K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 21/25] Staging: hv: vmbus: Get rid " K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 22/25] Staging: hv: vmbus: Do not allocate struct hv_device_info on the stack K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 23/25] Staging: hv: netvsc: Rename netDevice as net_device K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 24/25] Staging: hv: netvsc: Rename rndisDevice to rndis_device K. Y. Srinivasan
2011-09-08 14:24 ` [PATCH 25/25] Staging: hv: netvsc: Rename deviceInfo as device_info 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=1315491876-9554-7-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=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).