Staging: hv: storvsc: Get rid of alloc_stor_device() by inlining the code
Get rid of alloc_stor_device() by inlining the code. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6e4198ce18
commit
a13d35ab9f
@@ -332,23 +332,6 @@ static inline void storvsc_wait_to_drain(struct storvsc_device *dev)
|
|||||||
dev->drain_notify = false;
|
dev->drain_notify = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
|
|
||||||
{
|
|
||||||
struct storvsc_device *stor_device;
|
|
||||||
|
|
||||||
stor_device = kzalloc(sizeof(struct storvsc_device), GFP_KERNEL);
|
|
||||||
if (!stor_device)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
stor_device->destroy = false;
|
|
||||||
init_waitqueue_head(&stor_device->waiting_to_drain);
|
|
||||||
stor_device->device = device;
|
|
||||||
device->ext = stor_device;
|
|
||||||
|
|
||||||
return stor_device;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static inline struct storvsc_device *get_in_stor_device(
|
static inline struct storvsc_device *get_in_stor_device(
|
||||||
struct hv_device *device)
|
struct hv_device *device)
|
||||||
{
|
{
|
||||||
@@ -1382,13 +1365,18 @@ static int storvsc_probe(struct hv_device *device,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
stor_device = alloc_stor_device(device);
|
stor_device = kzalloc(sizeof(struct storvsc_device), GFP_KERNEL);
|
||||||
if (!stor_device) {
|
if (!stor_device) {
|
||||||
kmem_cache_destroy(host_dev->request_pool);
|
kmem_cache_destroy(host_dev->request_pool);
|
||||||
scsi_host_put(host);
|
scsi_host_put(host);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stor_device->destroy = false;
|
||||||
|
init_waitqueue_head(&stor_device->waiting_to_drain);
|
||||||
|
stor_device->device = device;
|
||||||
|
device->ext = stor_device;
|
||||||
|
|
||||||
stor_device->port_number = host->host_no;
|
stor_device->port_number = host->host_no;
|
||||||
ret = storvsc_connect_to_vsp(device, storvsc_ringbuffer_size);
|
ret = storvsc_connect_to_vsp(device, storvsc_ringbuffer_size);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
Reference in New Issue
Block a user