aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamie Wellnitz <Jamie.Wellnitz@emulex.com>2006-02-28 19:25:24 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-02-28 19:58:02 -0500
commit7f0b5b1913ba20ae035adbaeca176e78a53fa7a8 (patch)
tree9919be31d3cf0cef742536aec9cf885883848184
parentc9f8735beadfba403045c4423c91bbcf594b6ef2 (diff)
[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: Jamie Wellnitz <Jamie.Wellnitz@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c64
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c3
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c14
3 files changed, 40 insertions, 41 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index b897e522a966..c8fb43d60882 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -79,7 +79,7 @@ static ssize_t
79lpfc_serialnum_show(struct class_device *cdev, char *buf) 79lpfc_serialnum_show(struct class_device *cdev, char *buf)
80{ 80{
81 struct Scsi_Host *host = class_to_shost(cdev); 81 struct Scsi_Host *host = class_to_shost(cdev);
82 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 82 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
83 return snprintf(buf, PAGE_SIZE, "%s\n",phba->SerialNumber); 83 return snprintf(buf, PAGE_SIZE, "%s\n",phba->SerialNumber);
84} 84}
85 85
@@ -87,7 +87,7 @@ static ssize_t
87lpfc_modeldesc_show(struct class_device *cdev, char *buf) 87lpfc_modeldesc_show(struct class_device *cdev, char *buf)
88{ 88{
89 struct Scsi_Host *host = class_to_shost(cdev); 89 struct Scsi_Host *host = class_to_shost(cdev);
90 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 90 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
91 return snprintf(buf, PAGE_SIZE, "%s\n",phba->ModelDesc); 91 return snprintf(buf, PAGE_SIZE, "%s\n",phba->ModelDesc);
92} 92}
93 93
@@ -95,7 +95,7 @@ static ssize_t
95lpfc_modelname_show(struct class_device *cdev, char *buf) 95lpfc_modelname_show(struct class_device *cdev, char *buf)
96{ 96{
97 struct Scsi_Host *host = class_to_shost(cdev); 97 struct Scsi_Host *host = class_to_shost(cdev);
98 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 98 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
99 return snprintf(buf, PAGE_SIZE, "%s\n",phba->ModelName); 99 return snprintf(buf, PAGE_SIZE, "%s\n",phba->ModelName);
100} 100}
101 101
@@ -103,7 +103,7 @@ static ssize_t
103lpfc_programtype_show(struct class_device *cdev, char *buf) 103lpfc_programtype_show(struct class_device *cdev, char *buf)
104{ 104{
105 struct Scsi_Host *host = class_to_shost(cdev); 105 struct Scsi_Host *host = class_to_shost(cdev);
106 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 106 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
107 return snprintf(buf, PAGE_SIZE, "%s\n",phba->ProgramType); 107 return snprintf(buf, PAGE_SIZE, "%s\n",phba->ProgramType);
108} 108}
109 109
@@ -111,7 +111,7 @@ static ssize_t
111lpfc_portnum_show(struct class_device *cdev, char *buf) 111lpfc_portnum_show(struct class_device *cdev, char *buf)
112{ 112{
113 struct Scsi_Host *host = class_to_shost(cdev); 113 struct Scsi_Host *host = class_to_shost(cdev);
114 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 114 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
115 return snprintf(buf, PAGE_SIZE, "%s\n",phba->Port); 115 return snprintf(buf, PAGE_SIZE, "%s\n",phba->Port);
116} 116}
117 117
@@ -119,7 +119,7 @@ static ssize_t
119lpfc_fwrev_show(struct class_device *cdev, char *buf) 119lpfc_fwrev_show(struct class_device *cdev, char *buf)
120{ 120{
121 struct Scsi_Host *host = class_to_shost(cdev); 121 struct Scsi_Host *host = class_to_shost(cdev);
122 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 122 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
123 char fwrev[32]; 123 char fwrev[32];
124 lpfc_decode_firmware_rev(phba, fwrev, 1); 124 lpfc_decode_firmware_rev(phba, fwrev, 1);
125 return snprintf(buf, PAGE_SIZE, "%s\n",fwrev); 125 return snprintf(buf, PAGE_SIZE, "%s\n",fwrev);
@@ -130,7 +130,7 @@ lpfc_hdw_show(struct class_device *cdev, char *buf)
130{ 130{
131 char hdw[9]; 131 char hdw[9];
132 struct Scsi_Host *host = class_to_shost(cdev); 132 struct Scsi_Host *host = class_to_shost(cdev);
133 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 133 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
134 lpfc_vpd_t *vp = &phba->vpd; 134 lpfc_vpd_t *vp = &phba->vpd;
135 lpfc_jedec_to_ascii(vp->rev.biuRev, hdw); 135 lpfc_jedec_to_ascii(vp->rev.biuRev, hdw);
136 return snprintf(buf, PAGE_SIZE, "%s\n", hdw); 136 return snprintf(buf, PAGE_SIZE, "%s\n", hdw);
@@ -139,14 +139,14 @@ static ssize_t
139lpfc_option_rom_version_show(struct class_device *cdev, char *buf) 139lpfc_option_rom_version_show(struct class_device *cdev, char *buf)
140{ 140{
141 struct Scsi_Host *host = class_to_shost(cdev); 141 struct Scsi_Host *host = class_to_shost(cdev);
142 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 142 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
143 return snprintf(buf, PAGE_SIZE, "%s\n", phba->OptionROMVersion); 143 return snprintf(buf, PAGE_SIZE, "%s\n", phba->OptionROMVersion);
144} 144}
145static ssize_t 145static ssize_t
146lpfc_state_show(struct class_device *cdev, char *buf) 146lpfc_state_show(struct class_device *cdev, char *buf)
147{ 147{
148 struct Scsi_Host *host = class_to_shost(cdev); 148 struct Scsi_Host *host = class_to_shost(cdev);
149 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 149 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
150 int len = 0; 150 int len = 0;
151 switch (phba->hba_state) { 151 switch (phba->hba_state) {
152 case LPFC_INIT_START: 152 case LPFC_INIT_START:
@@ -194,7 +194,7 @@ static ssize_t
194lpfc_num_discovered_ports_show(struct class_device *cdev, char *buf) 194lpfc_num_discovered_ports_show(struct class_device *cdev, char *buf)
195{ 195{
196 struct Scsi_Host *host = class_to_shost(cdev); 196 struct Scsi_Host *host = class_to_shost(cdev);
197 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 197 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
198 return snprintf(buf, PAGE_SIZE, "%d\n", phba->fc_map_cnt + 198 return snprintf(buf, PAGE_SIZE, "%d\n", phba->fc_map_cnt +
199 phba->fc_unmap_cnt); 199 phba->fc_unmap_cnt);
200} 200}
@@ -203,7 +203,7 @@ lpfc_num_discovered_ports_show(struct class_device *cdev, char *buf)
203static int 203static int
204lpfc_issue_lip(struct Scsi_Host *host) 204lpfc_issue_lip(struct Scsi_Host *host)
205{ 205{
206 struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata[0]; 206 struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata;
207 LPFC_MBOXQ_t *pmboxq; 207 LPFC_MBOXQ_t *pmboxq;
208 int mbxstatus = MBXERR_ERROR; 208 int mbxstatus = MBXERR_ERROR;
209 209
@@ -235,7 +235,7 @@ static ssize_t
235lpfc_nport_evt_cnt_show(struct class_device *cdev, char *buf) 235lpfc_nport_evt_cnt_show(struct class_device *cdev, char *buf)
236{ 236{
237 struct Scsi_Host *host = class_to_shost(cdev); 237 struct Scsi_Host *host = class_to_shost(cdev);
238 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 238 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
239 return snprintf(buf, PAGE_SIZE, "%d\n", phba->nport_event_cnt); 239 return snprintf(buf, PAGE_SIZE, "%d\n", phba->nport_event_cnt);
240} 240}
241 241
@@ -243,7 +243,7 @@ static ssize_t
243lpfc_board_online_show(struct class_device *cdev, char *buf) 243lpfc_board_online_show(struct class_device *cdev, char *buf)
244{ 244{
245 struct Scsi_Host *host = class_to_shost(cdev); 245 struct Scsi_Host *host = class_to_shost(cdev);
246 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 246 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
247 247
248 if (phba->fc_flag & FC_OFFLINE_MODE) 248 if (phba->fc_flag & FC_OFFLINE_MODE)
249 return snprintf(buf, PAGE_SIZE, "0\n"); 249 return snprintf(buf, PAGE_SIZE, "0\n");
@@ -256,7 +256,7 @@ lpfc_board_online_store(struct class_device *cdev, const char *buf,
256 size_t count) 256 size_t count)
257{ 257{
258 struct Scsi_Host *host = class_to_shost(cdev); 258 struct Scsi_Host *host = class_to_shost(cdev);
259 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 259 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
260 struct completion online_compl; 260 struct completion online_compl;
261 int val=0, status=0; 261 int val=0, status=0;
262 262
@@ -282,7 +282,7 @@ static ssize_t
282lpfc_poll_show(struct class_device *cdev, char *buf) 282lpfc_poll_show(struct class_device *cdev, char *buf)
283{ 283{
284 struct Scsi_Host *host = class_to_shost(cdev); 284 struct Scsi_Host *host = class_to_shost(cdev);
285 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 285 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
286 286
287 return snprintf(buf, PAGE_SIZE, "%#x\n", phba->cfg_poll); 287 return snprintf(buf, PAGE_SIZE, "%#x\n", phba->cfg_poll);
288} 288}
@@ -292,7 +292,7 @@ lpfc_poll_store(struct class_device *cdev, const char *buf,
292 size_t count) 292 size_t count)
293{ 293{
294 struct Scsi_Host *host = class_to_shost(cdev); 294 struct Scsi_Host *host = class_to_shost(cdev);
295 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 295 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
296 uint32_t creg_val; 296 uint32_t creg_val;
297 uint32_t old_val; 297 uint32_t old_val;
298 int val=0; 298 int val=0;
@@ -349,7 +349,7 @@ static ssize_t \
349lpfc_##attr##_show(struct class_device *cdev, char *buf) \ 349lpfc_##attr##_show(struct class_device *cdev, char *buf) \
350{ \ 350{ \
351 struct Scsi_Host *host = class_to_shost(cdev);\ 351 struct Scsi_Host *host = class_to_shost(cdev);\
352 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0];\ 352 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;\
353 int val = 0;\ 353 int val = 0;\
354 val = phba->cfg_##attr;\ 354 val = phba->cfg_##attr;\
355 return snprintf(buf, PAGE_SIZE, "%d\n",\ 355 return snprintf(buf, PAGE_SIZE, "%d\n",\
@@ -361,7 +361,7 @@ static ssize_t \
361lpfc_##attr##_show(struct class_device *cdev, char *buf) \ 361lpfc_##attr##_show(struct class_device *cdev, char *buf) \
362{ \ 362{ \
363 struct Scsi_Host *host = class_to_shost(cdev);\ 363 struct Scsi_Host *host = class_to_shost(cdev);\
364 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0];\ 364 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;\
365 int val = 0;\ 365 int val = 0;\
366 val = phba->cfg_##attr;\ 366 val = phba->cfg_##attr;\
367 return snprintf(buf, PAGE_SIZE, "%#x\n",\ 367 return snprintf(buf, PAGE_SIZE, "%#x\n",\
@@ -404,7 +404,7 @@ static ssize_t \
404lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \ 404lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \
405{ \ 405{ \
406 struct Scsi_Host *host = class_to_shost(cdev);\ 406 struct Scsi_Host *host = class_to_shost(cdev);\
407 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0];\ 407 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;\
408 int val=0;\ 408 int val=0;\
409 if (!isdigit(buf[0]))\ 409 if (!isdigit(buf[0]))\
410 return -EINVAL;\ 410 return -EINVAL;\
@@ -685,7 +685,7 @@ sysfs_ctlreg_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
685 size_t buf_off; 685 size_t buf_off;
686 struct Scsi_Host *host = class_to_shost(container_of(kobj, 686 struct Scsi_Host *host = class_to_shost(container_of(kobj,
687 struct class_device, kobj)); 687 struct class_device, kobj));
688 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 688 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
689 689
690 if ((off + count) > FF_REG_AREA_SIZE) 690 if ((off + count) > FF_REG_AREA_SIZE)
691 return -ERANGE; 691 return -ERANGE;
@@ -718,7 +718,7 @@ sysfs_ctlreg_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
718 uint32_t * tmp_ptr; 718 uint32_t * tmp_ptr;
719 struct Scsi_Host *host = class_to_shost(container_of(kobj, 719 struct Scsi_Host *host = class_to_shost(container_of(kobj,
720 struct class_device, kobj)); 720 struct class_device, kobj));
721 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 721 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
722 722
723 if (off > FF_REG_AREA_SIZE) 723 if (off > FF_REG_AREA_SIZE)
724 return -ERANGE; 724 return -ERANGE;
@@ -773,7 +773,7 @@ sysfs_mbox_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
773{ 773{
774 struct Scsi_Host * host = 774 struct Scsi_Host * host =
775 class_to_shost(container_of(kobj, struct class_device, kobj)); 775 class_to_shost(container_of(kobj, struct class_device, kobj));
776 struct lpfc_hba * phba = (struct lpfc_hba*)host->hostdata[0]; 776 struct lpfc_hba * phba = (struct lpfc_hba*)host->hostdata;
777 struct lpfcMboxq * mbox = NULL; 777 struct lpfcMboxq * mbox = NULL;
778 778
779 if ((count + off) > MAILBOX_CMD_SIZE) 779 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 struct Scsi_Host *host = 826 struct Scsi_Host *host =
827 class_to_shost(container_of(kobj, struct class_device, 827 class_to_shost(container_of(kobj, struct class_device,
828 kobj)); 828 kobj));
829 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0]; 829 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
830 int rc; 830 int rc;
831 831
832 if (off > sizeof(MAILBOX_t)) 832 if (off > sizeof(MAILBOX_t))
@@ -1001,7 +1001,7 @@ lpfc_free_sysfs_attr(struct lpfc_hba *phba)
1001static void 1001static void
1002lpfc_get_host_port_id(struct Scsi_Host *shost) 1002lpfc_get_host_port_id(struct Scsi_Host *shost)
1003{ 1003{
1004 struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; 1004 struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata;
1005 /* note: fc_myDID already in cpu endianness */ 1005 /* note: fc_myDID already in cpu endianness */
1006 fc_host_port_id(shost) = phba->fc_myDID; 1006 fc_host_port_id(shost) = phba->fc_myDID;
1007} 1007}
@@ -1009,7 +1009,7 @@ lpfc_get_host_port_id(struct Scsi_Host *shost)
1009static void 1009static void
1010lpfc_get_host_port_type(struct Scsi_Host *shost) 1010lpfc_get_host_port_type(struct Scsi_Host *shost)
1011{ 1011{
1012 struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; 1012 struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata;
1013 1013
1014 spin_lock_irq(shost->host_lock); 1014 spin_lock_irq(shost->host_lock);
1015 1015
@@ -1034,7 +1034,7 @@ lpfc_get_host_port_type(struct Scsi_Host *shost)
1034static void 1034static void
1035lpfc_get_host_port_state(struct Scsi_Host *shost) 1035lpfc_get_host_port_state(struct Scsi_Host *shost)
1036{ 1036{
1037 struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; 1037 struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata;
1038 1038
1039 spin_lock_irq(shost->host_lock); 1039 spin_lock_irq(shost->host_lock);
1040 1040
@@ -1075,7 +1075,7 @@ lpfc_get_host_port_state(struct Scsi_Host *shost)
1075static void 1075static void
1076lpfc_get_host_speed(struct Scsi_Host *shost) 1076lpfc_get_host_speed(struct Scsi_Host *shost)
1077{ 1077{
1078 struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; 1078 struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata;
1079 1079
1080 spin_lock_irq(shost->host_lock); 1080 spin_lock_irq(shost->host_lock);
1081 1081
@@ -1102,7 +1102,7 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
1102static void 1102static void
1103lpfc_get_host_fabric_name (struct Scsi_Host *shost) 1103lpfc_get_host_fabric_name (struct Scsi_Host *shost)
1104{ 1104{
1105 struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata[0]; 1105 struct lpfc_hba *phba = (struct lpfc_hba*)shost->hostdata;
1106 u64 node_name; 1106 u64 node_name;
1107 1107
1108 spin_lock_irq(shost->host_lock); 1108 spin_lock_irq(shost->host_lock);
@@ -1124,7 +1124,7 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
1124static struct fc_host_statistics * 1124static struct fc_host_statistics *
1125lpfc_get_stats(struct Scsi_Host *shost) 1125lpfc_get_stats(struct Scsi_Host *shost)
1126{ 1126{
1127 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; 1127 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata;
1128 struct lpfc_sli *psli = &phba->sli; 1128 struct lpfc_sli *psli = &phba->sli;
1129 struct fc_host_statistics *hs = &phba->link_stats; 1129 struct fc_host_statistics *hs = &phba->link_stats;
1130 LPFC_MBOXQ_t *pmboxq; 1130 LPFC_MBOXQ_t *pmboxq;
@@ -1214,7 +1214,7 @@ static void
1214lpfc_get_starget_port_id(struct scsi_target *starget) 1214lpfc_get_starget_port_id(struct scsi_target *starget)
1215{ 1215{
1216 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 1216 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
1217 struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0]; 1217 struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata;
1218 uint32_t did = -1; 1218 uint32_t did = -1;
1219 struct lpfc_nodelist *ndlp = NULL; 1219 struct lpfc_nodelist *ndlp = NULL;
1220 1220
@@ -1235,7 +1235,7 @@ static void
1235lpfc_get_starget_node_name(struct scsi_target *starget) 1235lpfc_get_starget_node_name(struct scsi_target *starget)
1236{ 1236{
1237 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 1237 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
1238 struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0]; 1238 struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata;
1239 u64 node_name = 0; 1239 u64 node_name = 0;
1240 struct lpfc_nodelist *ndlp = NULL; 1240 struct lpfc_nodelist *ndlp = NULL;
1241 1241
@@ -1256,7 +1256,7 @@ static void
1256lpfc_get_starget_port_name(struct scsi_target *starget) 1256lpfc_get_starget_port_name(struct scsi_target *starget)
1257{ 1257{
1258 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 1258 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
1259 struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata[0]; 1259 struct lpfc_hba *phba = (struct lpfc_hba *) shost->hostdata;
1260 u64 port_name = 0; 1260 u64 port_name = 0;
1261 struct lpfc_nodelist *ndlp = NULL; 1261 struct lpfc_nodelist *ndlp = NULL;
1262 1262
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 369487e8f450..5e92c451f96e 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1553,7 +1553,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1553 INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list); 1553 INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list);
1554 1554
1555 host->transportt = lpfc_transport_template; 1555 host->transportt = lpfc_transport_template;
1556 host->hostdata[0] = (unsigned long)phba;
1557 pci_set_drvdata(pdev, host); 1556 pci_set_drvdata(pdev, host);
1558 error = scsi_add_host(host, &pdev->dev); 1557 error = scsi_add_host(host, &pdev->dev);
1559 if (error) 1558 if (error)
@@ -1675,7 +1674,7 @@ static void __devexit
1675lpfc_pci_remove_one(struct pci_dev *pdev) 1674lpfc_pci_remove_one(struct pci_dev *pdev)
1676{ 1675{
1677 struct Scsi_Host *host = pci_get_drvdata(pdev); 1676 struct Scsi_Host *host = pci_get_drvdata(pdev);
1678 struct lpfc_hba *phba = (struct lpfc_hba *)host->hostdata[0]; 1677 struct lpfc_hba *phba = (struct lpfc_hba *)host->hostdata;
1679 unsigned long iflag; 1678 unsigned long iflag;
1680 1679
1681 lpfc_free_sysfs_attr(phba); 1680 lpfc_free_sysfs_attr(phba);
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index dafabeefc5b3..fd7540ea4e19 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -743,7 +743,7 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba)
743const char * 743const char *
744lpfc_info(struct Scsi_Host *host) 744lpfc_info(struct Scsi_Host *host)
745{ 745{
746 struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata[0]; 746 struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata;
747 int len; 747 int len;
748 static char lpfcinfobuf[384]; 748 static char lpfcinfobuf[384];
749 749
@@ -803,7 +803,7 @@ static int
803lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) 803lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
804{ 804{
805 struct lpfc_hba *phba = 805 struct lpfc_hba *phba =
806 (struct lpfc_hba *) cmnd->device->host->hostdata[0]; 806 (struct lpfc_hba *) cmnd->device->host->hostdata;
807 struct lpfc_sli *psli = &phba->sli; 807 struct lpfc_sli *psli = &phba->sli;
808 struct lpfc_rport_data *rdata = cmnd->device->hostdata; 808 struct lpfc_rport_data *rdata = cmnd->device->hostdata;
809 struct lpfc_nodelist *ndlp = rdata->pnode; 809 struct lpfc_nodelist *ndlp = rdata->pnode;
@@ -877,7 +877,7 @@ static int
877lpfc_abort_handler(struct scsi_cmnd *cmnd) 877lpfc_abort_handler(struct scsi_cmnd *cmnd)
878{ 878{
879 struct Scsi_Host *shost = cmnd->device->host; 879 struct Scsi_Host *shost = cmnd->device->host;
880 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; 880 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata;
881 struct lpfc_sli_ring *pring = &phba->sli.ring[phba->sli.fcp_ring]; 881 struct lpfc_sli_ring *pring = &phba->sli.ring[phba->sli.fcp_ring];
882 struct lpfc_iocbq *iocb; 882 struct lpfc_iocbq *iocb;
883 struct lpfc_iocbq *abtsiocb; 883 struct lpfc_iocbq *abtsiocb;
@@ -981,7 +981,7 @@ static int
981lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) 981lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
982{ 982{
983 struct Scsi_Host *shost = cmnd->device->host; 983 struct Scsi_Host *shost = cmnd->device->host;
984 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; 984 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata;
985 struct lpfc_scsi_buf *lpfc_cmd; 985 struct lpfc_scsi_buf *lpfc_cmd;
986 struct lpfc_iocbq *iocbq, *iocbqrsp; 986 struct lpfc_iocbq *iocbq, *iocbqrsp;
987 struct lpfc_rport_data *rdata = cmnd->device->hostdata; 987 struct lpfc_rport_data *rdata = cmnd->device->hostdata;
@@ -1094,7 +1094,7 @@ static int
1094lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) 1094lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1095{ 1095{
1096 struct Scsi_Host *shost = cmnd->device->host; 1096 struct Scsi_Host *shost = cmnd->device->host;
1097 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; 1097 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata;
1098 struct lpfc_nodelist *ndlp = NULL; 1098 struct lpfc_nodelist *ndlp = NULL;
1099 int match; 1099 int match;
1100 int ret = FAILED, i, err_count = 0; 1100 int ret = FAILED, i, err_count = 0;
@@ -1195,7 +1195,7 @@ out:
1195static int 1195static int
1196lpfc_slave_alloc(struct scsi_device *sdev) 1196lpfc_slave_alloc(struct scsi_device *sdev)
1197{ 1197{
1198 struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata[0]; 1198 struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata;
1199 struct lpfc_scsi_buf *scsi_buf = NULL; 1199 struct lpfc_scsi_buf *scsi_buf = NULL;
1200 struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); 1200 struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
1201 uint32_t total = 0, i; 1201 uint32_t total = 0, i;
@@ -1251,7 +1251,7 @@ lpfc_slave_alloc(struct scsi_device *sdev)
1251static int 1251static int
1252lpfc_slave_configure(struct scsi_device *sdev) 1252lpfc_slave_configure(struct scsi_device *sdev)
1253{ 1253{
1254 struct lpfc_hba *phba = (struct lpfc_hba *) sdev->host->hostdata[0]; 1254 struct lpfc_hba *phba = (struct lpfc_hba *) sdev->host->hostdata;
1255 struct fc_rport *rport = starget_to_rport(sdev->sdev_target); 1255 struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
1256 1256
1257 if (sdev->tagged_supported) 1257 if (sdev->tagged_supported)