Commit 7f0b5b19 authored by Jamie Wellnitz's avatar Jamie Wellnitz Committed by James Bottomley

[SCSI] lpfc 8.1.2: Correct use of the hostdata field in scsi_host

Correct use of the hostdata field in scsi_host
Signed-off-by: default avatarJamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent c9f8735b
...@@ -79,7 +79,7 @@ static ssize_t ...@@ -79,7 +79,7 @@ static ssize_t
lpfc_serialnum_show(struct class_device *cdev, char *buf) lpfc_serialnum_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
return snprintf(buf, PAGE_SIZE, "%s\n",phba->SerialNumber); return snprintf(buf, PAGE_SIZE, "%s\n",phba->SerialNumber);
} }
...@@ -87,7 +87,7 @@ static ssize_t ...@@ -87,7 +87,7 @@ static ssize_t
lpfc_modeldesc_show(struct class_device *cdev, char *buf) lpfc_modeldesc_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
return snprintf(buf, PAGE_SIZE, "%s\n",phba->ModelDesc); return snprintf(buf, PAGE_SIZE, "%s\n",phba->ModelDesc);
} }
...@@ -95,7 +95,7 @@ static ssize_t ...@@ -95,7 +95,7 @@ static ssize_t
lpfc_modelname_show(struct class_device *cdev, char *buf) lpfc_modelname_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
return snprintf(buf, PAGE_SIZE, "%s\n",phba->ModelName); return snprintf(buf, PAGE_SIZE, "%s\n",phba->ModelName);
} }
...@@ -103,7 +103,7 @@ static ssize_t ...@@ -103,7 +103,7 @@ static ssize_t
lpfc_programtype_show(struct class_device *cdev, char *buf) lpfc_programtype_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
return snprintf(buf, PAGE_SIZE, "%s\n",phba->ProgramType); return snprintf(buf, PAGE_SIZE, "%s\n",phba->ProgramType);
} }
...@@ -111,7 +111,7 @@ static ssize_t ...@@ -111,7 +111,7 @@ static ssize_t
lpfc_portnum_show(struct class_device *cdev, char *buf) lpfc_portnum_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
return snprintf(buf, PAGE_SIZE, "%s\n",phba->Port); return snprintf(buf, PAGE_SIZE, "%s\n",phba->Port);
} }
...@@ -119,7 +119,7 @@ static ssize_t ...@@ -119,7 +119,7 @@ static ssize_t
lpfc_fwrev_show(struct class_device *cdev, char *buf) lpfc_fwrev_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
char fwrev[32]; char fwrev[32];
lpfc_decode_firmware_rev(phba, fwrev, 1); lpfc_decode_firmware_rev(phba, fwrev, 1);
return snprintf(buf, PAGE_SIZE, "%s\n",fwrev); return snprintf(buf, PAGE_SIZE, "%s\n",fwrev);
...@@ -130,7 +130,7 @@ lpfc_hdw_show(struct class_device *cdev, char *buf) ...@@ -130,7 +130,7 @@ lpfc_hdw_show(struct class_device *cdev, char *buf)
{ {
char hdw[9]; char hdw[9];
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
lpfc_vpd_t *vp = &phba->vpd; lpfc_vpd_t *vp = &phba->vpd;
lpfc_jedec_to_ascii(vp->rev.biuRev, hdw); lpfc_jedec_to_ascii(vp->rev.biuRev, hdw);
return snprintf(buf, PAGE_SIZE, "%s\n", hdw); return snprintf(buf, PAGE_SIZE, "%s\n", hdw);
...@@ -139,14 +139,14 @@ static ssize_t ...@@ -139,14 +139,14 @@ static ssize_t
lpfc_option_rom_version_show(struct class_device *cdev, char *buf) lpfc_option_rom_version_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
return snprintf(buf, PAGE_SIZE, "%s\n", phba->OptionROMVersion); return snprintf(buf, PAGE_SIZE, "%s\n", phba->OptionROMVersion);
} }
static ssize_t static ssize_t
lpfc_state_show(struct class_device *cdev, char *buf) lpfc_state_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
int len = 0; int len = 0;
switch (phba->hba_state) { switch (phba->hba_state) {
case LPFC_INIT_START: case LPFC_INIT_START:
...@@ -194,7 +194,7 @@ static ssize_t ...@@ -194,7 +194,7 @@ static ssize_t
lpfc_num_discovered_ports_show(struct class_device *cdev, char *buf) lpfc_num_discovered_ports_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
return snprintf(buf, PAGE_SIZE, "%d\n", phba->fc_map_cnt + return snprintf(buf, PAGE_SIZE, "%d\n", phba->fc_map_cnt +
phba->fc_unmap_cnt); phba->fc_unmap_cnt);
} }
...@@ -203,7 +203,7 @@ lpfc_num_discovered_ports_show(struct class_device *cdev, char *buf) ...@@ -203,7 +203,7 @@ lpfc_num_discovered_ports_show(struct class_device *cdev, char *buf)
static int static int
lpfc_issue_lip(struct Scsi_Host *host) lpfc_issue_lip(struct Scsi_Host *host)
{ {
struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata;
LPFC_MBOXQ_t *pmboxq; LPFC_MBOXQ_t *pmboxq;
int mbxstatus = MBXERR_ERROR; int mbxstatus = MBXERR_ERROR;
...@@ -235,7 +235,7 @@ static ssize_t ...@@ -235,7 +235,7 @@ static ssize_t
lpfc_nport_evt_cnt_show(struct class_device *cdev, char *buf) lpfc_nport_evt_cnt_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
return snprintf(buf, PAGE_SIZE, "%d\n", phba->nport_event_cnt); return snprintf(buf, PAGE_SIZE, "%d\n", phba->nport_event_cnt);
} }
...@@ -243,7 +243,7 @@ static ssize_t ...@@ -243,7 +243,7 @@ static ssize_t
lpfc_board_online_show(struct class_device *cdev, char *buf) lpfc_board_online_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
if (phba->fc_flag & FC_OFFLINE_MODE) if (phba->fc_flag & FC_OFFLINE_MODE)
return snprintf(buf, PAGE_SIZE, "0\n"); return snprintf(buf, PAGE_SIZE, "0\n");
...@@ -256,7 +256,7 @@ lpfc_board_online_store(struct class_device *cdev, const char *buf, ...@@ -256,7 +256,7 @@ lpfc_board_online_store(struct class_device *cdev, const char *buf,
size_t count) size_t count)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
struct completion online_compl; struct completion online_compl;
int val=0, status=0; int val=0, status=0;
...@@ -282,7 +282,7 @@ static ssize_t ...@@ -282,7 +282,7 @@ static ssize_t
lpfc_poll_show(struct class_device *cdev, char *buf) lpfc_poll_show(struct class_device *cdev, char *buf)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
return snprintf(buf, PAGE_SIZE, "%#x\n", phba->cfg_poll); return snprintf(buf, PAGE_SIZE, "%#x\n", phba->cfg_poll);
} }
...@@ -292,7 +292,7 @@ lpfc_poll_store(struct class_device *cdev, const char *buf, ...@@ -292,7 +292,7 @@ lpfc_poll_store(struct class_device *cdev, const char *buf,
size_t count) size_t count)
{ {
struct Scsi_Host *host = class_to_shost(cdev); struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
uint32_t creg_val; uint32_t creg_val;
uint32_t old_val; uint32_t old_val;
int val=0; int val=0;
...@@ -349,7 +349,7 @@ static ssize_t \ ...@@ -349,7 +349,7 @@ static ssize_t \
lpfc_##attr##_show(struct class_device *cdev, char *buf) \ lpfc_##attr##_show(struct class_device *cdev, char *buf) \
{ \ { \
struct Scsi_Host *host = class_to_shost(cdev);\ struct Scsi_Host *host = class_to_shost(cdev);\
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0];\ struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;\
int val = 0;\ int val = 0;\
val = phba->cfg_##attr;\ val = phba->cfg_##attr;\
return snprintf(buf, PAGE_SIZE, "%d\n",\ return snprintf(buf, PAGE_SIZE, "%d\n",\
...@@ -361,7 +361,7 @@ static ssize_t \ ...@@ -361,7 +361,7 @@ static ssize_t \
lpfc_##attr##_show(struct class_device *cdev, char *buf) \ lpfc_##attr##_show(struct class_device *cdev, char *buf) \
{ \ { \
struct Scsi_Host *host = class_to_shost(cdev);\ struct Scsi_Host *host = class_to_shost(cdev);\
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0];\ struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;\
int val = 0;\ int val = 0;\
val = phba->cfg_##attr;\ val = phba->cfg_##attr;\
return snprintf(buf, PAGE_SIZE, "%#x\n",\ return snprintf(buf, PAGE_SIZE, "%#x\n",\
...@@ -404,7 +404,7 @@ static ssize_t \ ...@@ -404,7 +404,7 @@ static ssize_t \
lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \ lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \
{ \ { \
struct Scsi_Host *host = class_to_shost(cdev);\ struct Scsi_Host *host = class_to_shost(cdev);\
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0];\ struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;\
int val=0;\ int val=0;\
if (!isdigit(buf[0]))\ if (!isdigit(buf[0]))\
return -EINVAL;\ return -EINVAL;\
...@@ -685,7 +685,7 @@ sysfs_ctlreg_write(struct kobject *kobj, char *buf, loff_t off, size_t count) ...@@ -685,7 +685,7 @@ sysfs_ctlreg_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
size_t buf_off; size_t buf_off;
struct Scsi_Host *host = class_to_shost(container_of(kobj, struct Scsi_Host *host = class_to_shost(container_of(kobj,
struct class_device, kobj)); struct class_device, kobj));
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
if ((off + count) > FF_REG_AREA_SIZE) if ((off + count) > FF_REG_AREA_SIZE)
return -ERANGE; return -ERANGE;
...@@ -718,7 +718,7 @@ sysfs_ctlreg_read(struct kobject *kobj, char *buf, loff_t off, size_t count) ...@@ -718,7 +718,7 @@ sysfs_ctlreg_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
uint32_t * tmp_ptr; uint32_t * tmp_ptr;
struct Scsi_Host *host = class_to_shost(container_of(kobj, struct Scsi_Host *host = class_to_shost(container_of(kobj,
struct class_device, kobj)); struct class_device, kobj));
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
if (off > FF_REG_AREA_SIZE) if (off > FF_REG_AREA_SIZE)
return -ERANGE; return -ERANGE;
...@@ -773,7 +773,7 @@ sysfs_mbox_write(struct kobject *kobj, char *buf, loff_t off, size_t count) ...@@ -773,7 +773,7 @@ sysfs_mbox_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
{ {
struct Scsi_Host * host = struct Scsi_Host * host =
class_to_shost(container_of(kobj, struct class_device, kobj)); class_to_shost(container_of(kobj, struct class_device, kobj));
struct lpfc_hba * phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba * phba = (struct lpfc_hba*)host->hostdata;
struct lpfcMboxq * mbox = NULL; struct lpfcMboxq * mbox = NULL;
if ((count + off) > MAILBOX_CMD_SIZE) if ((count + off) > MAILBOX_CMD_SIZE)
...@@ -826,7 +826,7 @@ sysfs_mbox_read(struct kobject *kobj, char *buf, loff_t off, size_t count) ...@@ -826,7 +826,7 @@ sysfs_mbox_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
struct Scsi_Host *host = struct Scsi_Host *host =
class_to_shost(container_of(kobj, struct class_device, class_to_shost(container_of(kobj, struct class_device,
kobj)); kobj));
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
int rc; int rc;
if (off > sizeof(MAILBOX_t)) if (off > sizeof(MAILBOX_t))
...@@ -1001,7 +1001,7 @@ lpfc_free_sysfs_attr(struct lpfc_hba *phba) ...@@ -1001,7 +1001,7 @@ lpfc_free_sysfs_attr(struct lpfc_hba *phba)
static void static void
lpfc_get_host_port_id(struct Scsi_Host *shost) lpfc_get_host_port_id(struct Scsi_Host *shost)
{ {
struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata;
/* note: fc_myDID already in cpu endianness */ /* note: fc_myDID already in cpu endianness */
fc_host_port_id(shost) = phba->fc_myDID; fc_host_port_id(shost) = phba->fc_myDID;
} }
...@@ -1009,7 +1009,7 @@ lpfc_get_host_port_id(struct Scsi_Host *shost) ...@@ -1009,7 +1009,7 @@ lpfc_get_host_port_id(struct Scsi_Host *shost)
static void static void
lpfc_get_host_port_type(struct Scsi_Host *shost) lpfc_get_host_port_type(struct Scsi_Host *shost)
{ {
struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata;
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
...@@ -1034,7 +1034,7 @@ lpfc_get_host_port_type(struct Scsi_Host *shost) ...@@ -1034,7 +1034,7 @@ lpfc_get_host_port_type(struct Scsi_Host *shost)
static void static void
lpfc_get_host_port_state(struct Scsi_Host *shost) lpfc_get_host_port_state(struct Scsi_Host *shost)
{ {
struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata;
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
...@@ -1075,7 +1075,7 @@ lpfc_get_host_port_state(struct Scsi_Host *shost) ...@@ -1075,7 +1075,7 @@ lpfc_get_host_port_state(struct Scsi_Host *shost)
static void static void
lpfc_get_host_speed(struct Scsi_Host *shost) lpfc_get_host_speed(struct Scsi_Host *shost)
{ {
struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata;
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
...@@ -1102,7 +1102,7 @@ lpfc_get_host_speed(struct Scsi_Host *shost) ...@@ -1102,7 +1102,7 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
static void static void
lpfc_get_host_fabric_name (struct Scsi_Host *shost) lpfc_get_host_fabric_name (struct Scsi_Host *shost)
{ {
struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata;
u64 node_name; u64 node_name;
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
...@@ -1124,7 +1124,7 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost) ...@@ -1124,7 +1124,7 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
static struct fc_host_statistics * static struct fc_host_statistics *
lpfc_get_stats(struct Scsi_Host *shost) lpfc_get_stats(struct Scsi_Host *shost)
{ {
struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata;
struct lpfc_sli *psli = &phba->sli; struct lpfc_sli *psli = &phba->sli;
struct fc_host_statistics *hs = &phba->link_stats; struct fc_host_statistics *hs = &phba->link_stats;
LPFC_MBOXQ_t *pmboxq; LPFC_MBOXQ_t *pmboxq;
...@@ -1214,7 +1214,7 @@ static void ...@@ -1214,7 +1214,7 @@ static void
lpfc_get_starget_port_id(struct scsi_target *starget) lpfc_get_starget_port_id(struct scsi_target *starget)
{ {
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata;
uint32_t did = -1; uint32_t did = -1;
struct lpfc_nodelist *ndlp = NULL; struct lpfc_nodelist *ndlp = NULL;
...@@ -1235,7 +1235,7 @@ static void ...@@ -1235,7 +1235,7 @@ static void
lpfc_get_starget_node_name(struct scsi_target *starget) lpfc_get_starget_node_name(struct scsi_target *starget)
{ {
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata;
u64 node_name = 0; u64 node_name = 0;
struct lpfc_nodelist *ndlp = NULL; struct lpfc_nodelist *ndlp = NULL;
...@@ -1256,7 +1256,7 @@ static void ...@@ -1256,7 +1256,7 @@ static void
lpfc_get_starget_port_name(struct scsi_target *starget) lpfc_get_starget_port_name(struct scsi_target *starget)
{ {
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata;
u64 port_name = 0; u64 port_name = 0;
struct lpfc_nodelist *ndlp = NULL; struct lpfc_nodelist *ndlp = NULL;
......
...@@ -1553,7 +1553,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) ...@@ -1553,7 +1553,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list); INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list);
host->transportt = lpfc_transport_template; host->transportt = lpfc_transport_template;
host->hostdata[0] = (unsigned long)phba;
pci_set_drvdata(pdev, host); pci_set_drvdata(pdev, host);
error = scsi_add_host(host, &pdev->dev); error = scsi_add_host(host, &pdev->dev);
if (error) if (error)
...@@ -1675,7 +1674,7 @@ static void __devexit ...@@ -1675,7 +1674,7 @@ static void __devexit
lpfc_pci_remove_one(struct pci_dev *pdev) lpfc_pci_remove_one(struct pci_dev *pdev)
{ {
struct Scsi_Host *host = pci_get_drvdata(pdev); struct Scsi_Host *host = pci_get_drvdata(pdev);
struct lpfc_hba *phba = (struct lpfc_hba *)host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *)host->hostdata;
unsigned long iflag; unsigned long iflag;
lpfc_free_sysfs_attr(phba); lpfc_free_sysfs_attr(phba);
......
...@@ -743,7 +743,7 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba) ...@@ -743,7 +743,7 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba)
const char * const char *
lpfc_info(struct Scsi_Host *host) lpfc_info(struct Scsi_Host *host)
{ {
struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata;
int len; int len;
static char lpfcinfobuf[384]; static char lpfcinfobuf[384];
...@@ -803,7 +803,7 @@ static int ...@@ -803,7 +803,7 @@ static int
lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
{ {
struct lpfc_hba *phba = struct lpfc_hba *phba =
(struct lpfc_hba *) cmnd->device->host->hostdata[0]; (struct lpfc_hba *) cmnd->device->host->hostdata;
struct lpfc_sli *psli = &phba->sli; struct lpfc_sli *psli = &phba->sli;
struct lpfc_rport_data *rdata = cmnd->device->hostdata; struct lpfc_rport_data *rdata = cmnd->device->hostdata;
struct lpfc_nodelist *ndlp = rdata->pnode; struct lpfc_nodelist *ndlp = rdata->pnode;
...@@ -877,7 +877,7 @@ static int ...@@ -877,7 +877,7 @@ static int
lpfc_abort_handler(struct scsi_cmnd *cmnd) lpfc_abort_handler(struct scsi_cmnd *cmnd)
{ {
struct Scsi_Host *shost = cmnd->device->host; struct Scsi_Host *shost = cmnd->device->host;
struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata;
struct lpfc_sli_ring *pring = &phba->sli.ring[phba->sli.fcp_ring]; struct lpfc_sli_ring *pring = &phba->sli.ring[phba->sli.fcp_ring];
struct lpfc_iocbq *iocb; struct lpfc_iocbq *iocb;
struct lpfc_iocbq *abtsiocb; struct lpfc_iocbq *abtsiocb;
...@@ -981,7 +981,7 @@ static int ...@@ -981,7 +981,7 @@ static int
lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
{ {
struct Scsi_Host *shost = cmnd->device->host; struct Scsi_Host *shost = cmnd->device->host;
struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata;
struct lpfc_scsi_buf *lpfc_cmd; struct lpfc_scsi_buf *lpfc_cmd;
struct lpfc_iocbq *iocbq, *iocbqrsp; struct lpfc_iocbq *iocbq, *iocbqrsp;
struct lpfc_rport_data *rdata = cmnd->device->hostdata; struct lpfc_rport_data *rdata = cmnd->device->hostdata;
...@@ -1094,7 +1094,7 @@ static int ...@@ -1094,7 +1094,7 @@ static int
lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
{ {
struct Scsi_Host *shost = cmnd->device->host; struct Scsi_Host *shost = cmnd->device->host;
struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata;
struct lpfc_nodelist *ndlp = NULL; struct lpfc_nodelist *ndlp = NULL;
int match; int match;
int ret = FAILED, i, err_count = 0; int ret = FAILED, i, err_count = 0;
...@@ -1195,7 +1195,7 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) ...@@ -1195,7 +1195,7 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
static int static int
lpfc_slave_alloc(struct scsi_device *sdev) lpfc_slave_alloc(struct scsi_device *sdev)
{ {
struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata;
struct lpfc_scsi_buf *scsi_buf = NULL; struct lpfc_scsi_buf *scsi_buf = NULL;
struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
uint32_t total = 0, i; uint32_t total = 0, i;
...@@ -1251,7 +1251,7 @@ lpfc_slave_alloc(struct scsi_device *sdev) ...@@ -1251,7 +1251,7 @@ lpfc_slave_alloc(struct scsi_device *sdev)
static int static int
lpfc_slave_configure(struct scsi_device *sdev) lpfc_slave_configure(struct scsi_device *sdev)
{ {
struct lpfc_hba *phba = (struct lpfc_hba *) sdev->host->hostdata[0]; struct lpfc_hba *phba = (struct lpfc_hba *) sdev->host->hostdata;
struct fc_rport *rport = starget_to_rport(sdev->sdev_target); struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
if (sdev->tagged_supported) if (sdev->tagged_supported)
......
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