Commit 7f33f30a authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: storvsc: Use the accessor function shost_priv()

Use the accessor function shost_priv().
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a00e8224
...@@ -968,8 +968,7 @@ static int storvsc_remove(struct hv_device *dev) ...@@ -968,8 +968,7 @@ static int storvsc_remove(struct hv_device *dev)
{ {
struct storvsc_device *stor_device = hv_get_drvdata(dev); struct storvsc_device *stor_device = hv_get_drvdata(dev);
struct Scsi_Host *host = stor_device->host; struct Scsi_Host *host = stor_device->host;
struct hv_host_device *host_dev = struct hv_host_device *host_dev = shost_priv(host);
(struct hv_host_device *)host->hostdata;
scsi_remove_host(host); scsi_remove_host(host);
...@@ -1057,8 +1056,7 @@ static int storvsc_host_reset(struct hv_device *device) ...@@ -1057,8 +1056,7 @@ static int storvsc_host_reset(struct hv_device *device)
*/ */
static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
{ {
struct hv_host_device *host_dev = struct hv_host_device *host_dev = shost_priv(scmnd->device->host);
(struct hv_host_device *)scmnd->device->host->hostdata;
struct hv_device *dev = host_dev->dev; struct hv_device *dev = host_dev->dev;
return storvsc_host_reset(dev); return storvsc_host_reset(dev);
...@@ -1073,8 +1071,7 @@ static void storvsc_command_completion(struct hv_storvsc_request *request) ...@@ -1073,8 +1071,7 @@ static void storvsc_command_completion(struct hv_storvsc_request *request)
struct storvsc_cmd_request *cmd_request = struct storvsc_cmd_request *cmd_request =
(struct storvsc_cmd_request *)request->context; (struct storvsc_cmd_request *)request->context;
struct scsi_cmnd *scmnd = cmd_request->cmd; struct scsi_cmnd *scmnd = cmd_request->cmd;
struct hv_host_device *host_dev = struct hv_host_device *host_dev = shost_priv(scmnd->device->host);
(struct hv_host_device *)scmnd->device->host->hostdata;
void (*scsi_done_fn)(struct scsi_cmnd *); void (*scsi_done_fn)(struct scsi_cmnd *);
struct scsi_sense_hdr sense_hdr; struct scsi_sense_hdr sense_hdr;
struct vmscsi_request *vm_srb; struct vmscsi_request *vm_srb;
...@@ -1144,8 +1141,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, ...@@ -1144,8 +1141,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
void (*done)(struct scsi_cmnd *)) void (*done)(struct scsi_cmnd *))
{ {
int ret; int ret;
struct hv_host_device *host_dev = struct hv_host_device *host_dev = shost_priv(scmnd->device->host);
(struct hv_host_device *)scmnd->device->host->hostdata;
struct hv_device *dev = host_dev->dev; struct hv_device *dev = host_dev->dev;
struct hv_storvsc_request *request; struct hv_storvsc_request *request;
struct storvsc_cmd_request *cmd_request; struct storvsc_cmd_request *cmd_request;
...@@ -1359,7 +1355,7 @@ static int storvsc_probe(struct hv_device *device, ...@@ -1359,7 +1355,7 @@ static int storvsc_probe(struct hv_device *device,
if (!host) if (!host)
return -ENOMEM; return -ENOMEM;
host_dev = (struct hv_host_device *)host->hostdata; host_dev = shost_priv(host);
memset(host_dev, 0, sizeof(struct hv_host_device)); memset(host_dev, 0, sizeof(struct hv_host_device));
host_dev->port = host->host_no; host_dev->port = host->host_no;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment