Commit 7603e02e authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley

[SCSI] ibmvscsi: use shost_priv

Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: default avatarBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent ed3a3633
...@@ -702,8 +702,7 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd, ...@@ -702,8 +702,7 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,
struct srp_cmd *srp_cmd; struct srp_cmd *srp_cmd;
struct srp_event_struct *evt_struct; struct srp_event_struct *evt_struct;
struct srp_indirect_buf *indirect; struct srp_indirect_buf *indirect;
struct ibmvscsi_host_data *hostdata = struct ibmvscsi_host_data *hostdata = shost_priv(cmnd->device->host);
(struct ibmvscsi_host_data *)&cmnd->device->host->hostdata;
u16 lun = lun_from_dev(cmnd->device); u16 lun = lun_from_dev(cmnd->device);
u8 out_fmt, in_fmt; u8 out_fmt, in_fmt;
...@@ -954,8 +953,7 @@ static void sync_completion(struct srp_event_struct *evt_struct) ...@@ -954,8 +953,7 @@ static void sync_completion(struct srp_event_struct *evt_struct)
*/ */
static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
{ {
struct ibmvscsi_host_data *hostdata = struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host);
(struct ibmvscsi_host_data *)cmd->device->host->hostdata;
struct srp_tsk_mgmt *tsk_mgmt; struct srp_tsk_mgmt *tsk_mgmt;
struct srp_event_struct *evt; struct srp_event_struct *evt;
struct srp_event_struct *tmp_evt, *found_evt; struct srp_event_struct *tmp_evt, *found_evt;
...@@ -1078,9 +1076,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) ...@@ -1078,9 +1076,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
*/ */
static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
{ {
struct ibmvscsi_host_data *hostdata = struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host);
(struct ibmvscsi_host_data *)cmd->device->host->hostdata;
struct srp_tsk_mgmt *tsk_mgmt; struct srp_tsk_mgmt *tsk_mgmt;
struct srp_event_struct *evt; struct srp_event_struct *evt;
struct srp_event_struct *tmp_evt, *pos; struct srp_event_struct *tmp_evt, *pos;
...@@ -1177,8 +1173,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) ...@@ -1177,8 +1173,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
static int ibmvscsi_eh_host_reset_handler(struct scsi_cmnd *cmd) static int ibmvscsi_eh_host_reset_handler(struct scsi_cmnd *cmd)
{ {
unsigned long wait_switch = 0; unsigned long wait_switch = 0;
struct ibmvscsi_host_data *hostdata = struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host);
(struct ibmvscsi_host_data *)cmd->device->host->hostdata;
dev_err(hostdata->dev, "Resetting connection due to error recovery\n"); dev_err(hostdata->dev, "Resetting connection due to error recovery\n");
...@@ -1406,8 +1401,7 @@ static int ibmvscsi_change_queue_depth(struct scsi_device *sdev, int qdepth) ...@@ -1406,8 +1401,7 @@ static int ibmvscsi_change_queue_depth(struct scsi_device *sdev, int qdepth)
static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf) static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(class_dev); struct Scsi_Host *shost = class_to_shost(class_dev);
struct ibmvscsi_host_data *hostdata = struct ibmvscsi_host_data *hostdata = shost_priv(shost);
(struct ibmvscsi_host_data *)shost->hostdata;
int len; int len;
len = snprintf(buf, PAGE_SIZE, "%s\n", len = snprintf(buf, PAGE_SIZE, "%s\n",
...@@ -1427,8 +1421,7 @@ static ssize_t show_host_partition_name(struct class_device *class_dev, ...@@ -1427,8 +1421,7 @@ static ssize_t show_host_partition_name(struct class_device *class_dev,
char *buf) char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(class_dev); struct Scsi_Host *shost = class_to_shost(class_dev);
struct ibmvscsi_host_data *hostdata = struct ibmvscsi_host_data *hostdata = shost_priv(shost);
(struct ibmvscsi_host_data *)shost->hostdata;
int len; int len;
len = snprintf(buf, PAGE_SIZE, "%s\n", len = snprintf(buf, PAGE_SIZE, "%s\n",
...@@ -1448,8 +1441,7 @@ static ssize_t show_host_partition_number(struct class_device *class_dev, ...@@ -1448,8 +1441,7 @@ static ssize_t show_host_partition_number(struct class_device *class_dev,
char *buf) char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(class_dev); struct Scsi_Host *shost = class_to_shost(class_dev);
struct ibmvscsi_host_data *hostdata = struct ibmvscsi_host_data *hostdata = shost_priv(shost);
(struct ibmvscsi_host_data *)shost->hostdata;
int len; int len;
len = snprintf(buf, PAGE_SIZE, "%d\n", len = snprintf(buf, PAGE_SIZE, "%d\n",
...@@ -1468,8 +1460,7 @@ static struct class_device_attribute ibmvscsi_host_partition_number = { ...@@ -1468,8 +1460,7 @@ static struct class_device_attribute ibmvscsi_host_partition_number = {
static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf) static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(class_dev); struct Scsi_Host *shost = class_to_shost(class_dev);
struct ibmvscsi_host_data *hostdata = struct ibmvscsi_host_data *hostdata = shost_priv(shost);
(struct ibmvscsi_host_data *)shost->hostdata;
int len; int len;
len = snprintf(buf, PAGE_SIZE, "%d\n", len = snprintf(buf, PAGE_SIZE, "%d\n",
...@@ -1488,8 +1479,7 @@ static struct class_device_attribute ibmvscsi_host_mad_version = { ...@@ -1488,8 +1479,7 @@ static struct class_device_attribute ibmvscsi_host_mad_version = {
static ssize_t show_host_os_type(struct class_device *class_dev, char *buf) static ssize_t show_host_os_type(struct class_device *class_dev, char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(class_dev); struct Scsi_Host *shost = class_to_shost(class_dev);
struct ibmvscsi_host_data *hostdata = struct ibmvscsi_host_data *hostdata = shost_priv(shost);
(struct ibmvscsi_host_data *)shost->hostdata;
int len; int len;
len = snprintf(buf, PAGE_SIZE, "%d\n", hostdata->madapter_info.os_type); len = snprintf(buf, PAGE_SIZE, "%d\n", hostdata->madapter_info.os_type);
...@@ -1507,8 +1497,7 @@ static struct class_device_attribute ibmvscsi_host_os_type = { ...@@ -1507,8 +1497,7 @@ static struct class_device_attribute ibmvscsi_host_os_type = {
static ssize_t show_host_config(struct class_device *class_dev, char *buf) static ssize_t show_host_config(struct class_device *class_dev, char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(class_dev); struct Scsi_Host *shost = class_to_shost(class_dev);
struct ibmvscsi_host_data *hostdata = struct ibmvscsi_host_data *hostdata = shost_priv(shost);
(struct ibmvscsi_host_data *)shost->hostdata;
/* returns null-terminated host config data */ /* returns null-terminated host config data */
if (ibmvscsi_do_host_config(hostdata, buf, PAGE_SIZE) == 0) if (ibmvscsi_do_host_config(hostdata, buf, PAGE_SIZE) == 0)
...@@ -1576,7 +1565,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) ...@@ -1576,7 +1565,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
goto scsi_host_alloc_failed; goto scsi_host_alloc_failed;
} }
hostdata = (struct ibmvscsi_host_data *)host->hostdata; hostdata = shost_priv(host);
memset(hostdata, 0x00, sizeof(*hostdata)); memset(hostdata, 0x00, sizeof(*hostdata));
INIT_LIST_HEAD(&hostdata->sent); INIT_LIST_HEAD(&hostdata->sent);
hostdata->host = host; hostdata->host = host;
......
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