aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi/ibmvscsi.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2007-07-22 20:28:40 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-07-31 11:34:34 -0400
commit7603e02eac309626c0153ebddf277253ea7fe0e0 (patch)
tree7048bed26c04abcb0873ca1be7c2a91e94dfd2f0 /drivers/scsi/ibmvscsi/ibmvscsi.c
parented3a3633b798a15281f9c9a89a7e74d4bdd02ebe (diff)
[SCSI] ibmvscsi: use shost_priv
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi/ibmvscsi.c')
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 673526044e8b..5ecc63d1b436 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -702,8 +702,7 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,
702 struct srp_cmd *srp_cmd; 702 struct srp_cmd *srp_cmd;
703 struct srp_event_struct *evt_struct; 703 struct srp_event_struct *evt_struct;
704 struct srp_indirect_buf *indirect; 704 struct srp_indirect_buf *indirect;
705 struct ibmvscsi_host_data *hostdata = 705 struct ibmvscsi_host_data *hostdata = shost_priv(cmnd->device->host);
706 (struct ibmvscsi_host_data *)&cmnd->device->host->hostdata;
707 u16 lun = lun_from_dev(cmnd->device); 706 u16 lun = lun_from_dev(cmnd->device);
708 u8 out_fmt, in_fmt; 707 u8 out_fmt, in_fmt;
709 708
@@ -954,8 +953,7 @@ static void sync_completion(struct srp_event_struct *evt_struct)
954 */ 953 */
955static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) 954static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
956{ 955{
957 struct ibmvscsi_host_data *hostdata = 956 struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host);
958 (struct ibmvscsi_host_data *)cmd->device->host->hostdata;
959 struct srp_tsk_mgmt *tsk_mgmt; 957 struct srp_tsk_mgmt *tsk_mgmt;
960 struct srp_event_struct *evt; 958 struct srp_event_struct *evt;
961 struct srp_event_struct *tmp_evt, *found_evt; 959 struct srp_event_struct *tmp_evt, *found_evt;
@@ -1078,9 +1076,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
1078 */ 1076 */
1079static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) 1077static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
1080{ 1078{
1081 struct ibmvscsi_host_data *hostdata = 1079 struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host);
1082 (struct ibmvscsi_host_data *)cmd->device->host->hostdata;
1083
1084 struct srp_tsk_mgmt *tsk_mgmt; 1080 struct srp_tsk_mgmt *tsk_mgmt;
1085 struct srp_event_struct *evt; 1081 struct srp_event_struct *evt;
1086 struct srp_event_struct *tmp_evt, *pos; 1082 struct srp_event_struct *tmp_evt, *pos;
@@ -1177,8 +1173,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
1177static int ibmvscsi_eh_host_reset_handler(struct scsi_cmnd *cmd) 1173static int ibmvscsi_eh_host_reset_handler(struct scsi_cmnd *cmd)
1178{ 1174{
1179 unsigned long wait_switch = 0; 1175 unsigned long wait_switch = 0;
1180 struct ibmvscsi_host_data *hostdata = 1176 struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host);
1181 (struct ibmvscsi_host_data *)cmd->device->host->hostdata;
1182 1177
1183 dev_err(hostdata->dev, "Resetting connection due to error recovery\n"); 1178 dev_err(hostdata->dev, "Resetting connection due to error recovery\n");
1184 1179
@@ -1406,8 +1401,7 @@ static int ibmvscsi_change_queue_depth(struct scsi_device *sdev, int qdepth)
1406static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf) 1401static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf)
1407{ 1402{
1408 struct Scsi_Host *shost = class_to_shost(class_dev); 1403 struct Scsi_Host *shost = class_to_shost(class_dev);
1409 struct ibmvscsi_host_data *hostdata = 1404 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1410 (struct ibmvscsi_host_data *)shost->hostdata;
1411 int len; 1405 int len;
1412 1406
1413 len = snprintf(buf, PAGE_SIZE, "%s\n", 1407 len = snprintf(buf, PAGE_SIZE, "%s\n",
@@ -1427,8 +1421,7 @@ static ssize_t show_host_partition_name(struct class_device *class_dev,
1427 char *buf) 1421 char *buf)
1428{ 1422{
1429 struct Scsi_Host *shost = class_to_shost(class_dev); 1423 struct Scsi_Host *shost = class_to_shost(class_dev);
1430 struct ibmvscsi_host_data *hostdata = 1424 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1431 (struct ibmvscsi_host_data *)shost->hostdata;
1432 int len; 1425 int len;
1433 1426
1434 len = snprintf(buf, PAGE_SIZE, "%s\n", 1427 len = snprintf(buf, PAGE_SIZE, "%s\n",
@@ -1448,8 +1441,7 @@ static ssize_t show_host_partition_number(struct class_device *class_dev,
1448 char *buf) 1441 char *buf)
1449{ 1442{
1450 struct Scsi_Host *shost = class_to_shost(class_dev); 1443 struct Scsi_Host *shost = class_to_shost(class_dev);
1451 struct ibmvscsi_host_data *hostdata = 1444 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1452 (struct ibmvscsi_host_data *)shost->hostdata;
1453 int len; 1445 int len;
1454 1446
1455 len = snprintf(buf, PAGE_SIZE, "%d\n", 1447 len = snprintf(buf, PAGE_SIZE, "%d\n",
@@ -1468,8 +1460,7 @@ static struct class_device_attribute ibmvscsi_host_partition_number = {
1468static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf) 1460static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf)
1469{ 1461{
1470 struct Scsi_Host *shost = class_to_shost(class_dev); 1462 struct Scsi_Host *shost = class_to_shost(class_dev);
1471 struct ibmvscsi_host_data *hostdata = 1463 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1472 (struct ibmvscsi_host_data *)shost->hostdata;
1473 int len; 1464 int len;
1474 1465
1475 len = snprintf(buf, PAGE_SIZE, "%d\n", 1466 len = snprintf(buf, PAGE_SIZE, "%d\n",
@@ -1488,8 +1479,7 @@ static struct class_device_attribute ibmvscsi_host_mad_version = {
1488static ssize_t show_host_os_type(struct class_device *class_dev, char *buf) 1479static ssize_t show_host_os_type(struct class_device *class_dev, char *buf)
1489{ 1480{
1490 struct Scsi_Host *shost = class_to_shost(class_dev); 1481 struct Scsi_Host *shost = class_to_shost(class_dev);
1491 struct ibmvscsi_host_data *hostdata = 1482 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1492 (struct ibmvscsi_host_data *)shost->hostdata;
1493 int len; 1483 int len;
1494 1484
1495 len = snprintf(buf, PAGE_SIZE, "%d\n", hostdata->madapter_info.os_type); 1485 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 = {
1507static ssize_t show_host_config(struct class_device *class_dev, char *buf) 1497static ssize_t show_host_config(struct class_device *class_dev, char *buf)
1508{ 1498{
1509 struct Scsi_Host *shost = class_to_shost(class_dev); 1499 struct Scsi_Host *shost = class_to_shost(class_dev);
1510 struct ibmvscsi_host_data *hostdata = 1500 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1511 (struct ibmvscsi_host_data *)shost->hostdata;
1512 1501
1513 /* returns null-terminated host config data */ 1502 /* returns null-terminated host config data */
1514 if (ibmvscsi_do_host_config(hostdata, buf, PAGE_SIZE) == 0) 1503 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 goto scsi_host_alloc_failed; 1565 goto scsi_host_alloc_failed;
1577 } 1566 }
1578 1567
1579 hostdata = (struct ibmvscsi_host_data *)host->hostdata; 1568 hostdata = shost_priv(host);
1580 memset(hostdata, 0x00, sizeof(*hostdata)); 1569 memset(hostdata, 0x00, sizeof(*hostdata));
1581 INIT_LIST_HEAD(&hostdata->sent); 1570 INIT_LIST_HEAD(&hostdata->sent);
1582 hostdata->host = host; 1571 hostdata->host = host;