From: K. Y. Srinivasan Date: Tue, 26 Apr 2011 16:20:18 +0000 (-0700) Subject: Staging: hv: Introduce a function to map a generic driver pointer to a pointer to... X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0724e5fd77b44338fb12af35f0577bd4142903e8;p=linux-beck.git 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 Signed-off-by: Haiyang Zhang Signed-off-by: Abhishek Kane Signed-off-by: Hank Janssen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/storvsc_api.h b/drivers/staging/hv/storvsc_api.h index c98139cc7baf..b60a05879f99 100644 --- a/drivers/staging/hv/storvsc_api.h +++ b/drivers/staging/hv/storvsc_api.h @@ -28,6 +28,7 @@ #include #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,