Skip to content

Commit

Permalink
Staging: hv: remove unneeded OnHostReset callback
Browse files Browse the repository at this point in the history
This callback only calls one function, so just call the function
instead, no need for indirection at all.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Mar 4, 2010
1 parent 99358ca commit 354b0a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/hv/StorVsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ static int StorVscOnDeviceRemove(struct hv_device *Device)
return 0;
}

static int StorVscOnHostReset(struct hv_device *Device)
int StorVscOnHostReset(struct hv_device *Device)
{
struct storvsc_device *storDevice;
struct storvsc_request_extension *request;
Expand Down Expand Up @@ -842,7 +842,6 @@ int StorVscInitialize(struct hv_driver *Driver)
storDriver->Base.OnCleanup = StorVscOnCleanup;

storDriver->OnIORequest = StorVscOnIORequest;
storDriver->OnHostReset = StorVscOnHostReset;

DPRINT_EXIT(STORVSC);

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/hv/StorVscApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ struct storvsc_driver_object {
/* Specific to this driver */
int (*OnIORequest)(struct hv_device *Device,
struct hv_storvsc_request *Request);
int (*OnHostReset)(struct hv_device *Device);
};

struct storvsc_device_info {
Expand All @@ -105,6 +104,7 @@ struct storvsc_device_info {

/* Interface */
int StorVscInitialize(struct hv_driver *driver);
int StorVscOnHostReset(struct hv_device *Device);
int BlkVscInitialize(struct hv_driver *driver);

#endif /* _STORVSC_API_H_ */
10 changes: 1 addition & 9 deletions drivers/staging/hv/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,22 +870,14 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
struct host_device_context *host_device_ctx =
(struct host_device_context *)scmnd->device->host->hostdata;
struct device_context *device_ctx = host_device_ctx->device_ctx;
struct driver_context *driver_ctx =
driver_to_driver_context(device_ctx->device.driver);
struct storvsc_driver_context *storvsc_drv_ctx =
(struct storvsc_driver_context *)driver_ctx;

struct storvsc_driver_object *storvsc_drv_obj =
&storvsc_drv_ctx->drv_obj;

DPRINT_ENTER(STORVSC_DRV);

DPRINT_INFO(STORVSC_DRV, "sdev (%p) dev obj (%p) - host resetting...",
scmnd->device, &device_ctx->device_obj);

/* Invokes the vsc to reset the host/bus */
ASSERT(storvsc_drv_obj->OnHostReset);
ret = storvsc_drv_obj->OnHostReset(&device_ctx->device_obj);
ret = StorVscOnHostReset(&device_ctx->device_obj);
if (ret != 0) {
DPRINT_EXIT(STORVSC_DRV);
return ret;
Expand Down

0 comments on commit 354b0a6

Please sign in to comment.