summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2011-04-26 09:20:18 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-26 15:47:27 -0700
commit0724e5fd77b44338fb12af35f0577bd4142903e8 (patch)
treecac1138fdc51dde1b1548ea5b004c5ff59cbe589 /drivers
parenta12c27c5eac8e0b1ee6988c32a29100abe1a99ef (diff)
Staging: hv: Introduce a function to map a generic driver pointer to a pointer to storvsc_driver_object
In preparation for getting rid of the priv element from struct hv_driver, introduce a function that maps a generic struct driver pointer to struct storvsc_driver_object. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/hv/storvsc_api.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/hv/storvsc_api.h b/drivers/staging/hv/storvsc_api.h
index c98139cc7ba..b60a05879f9 100644
--- a/drivers/staging/hv/storvsc_api.h
+++ b/drivers/staging/hv/storvsc_api.h
@@ -28,6 +28,7 @@
#include <linux/kernel.h>
#include "vstorage.h"
#include "vmbus_api.h"
+#include "vmbus.h"
/* Defines */
#define STORVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
@@ -153,6 +154,13 @@ static inline struct storvsc_driver_object *hvdr_to_stordr(struct hv_driver *d)
return container_of(d, struct storvsc_driver_object, base);
}
+static inline
+struct storvsc_driver_object *drv_to_stordrv(struct device_driver *d)
+{
+ struct hv_driver *hvdrv = drv_to_hv_drv(d);
+ return hvdr_to_stordr(hvdrv);
+}
+
/* Interface */
int stor_vsc_on_device_add(struct hv_device *device,