diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/isci/host.h | 6 | ||||
-rw-r--r-- | drivers/scsi/isci/init.c | 16 |
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h index 9701c1d673ba..7272a0a375f2 100644 --- a/drivers/scsi/isci/host.h +++ b/drivers/scsi/isci/host.h | |||
@@ -203,7 +203,6 @@ struct isci_host { | |||
203 | #define IHOST_IRQ_ENABLED 2 | 203 | #define IHOST_IRQ_ENABLED 2 |
204 | unsigned long flags; | 204 | unsigned long flags; |
205 | wait_queue_head_t eventq; | 205 | wait_queue_head_t eventq; |
206 | struct Scsi_Host *shost; | ||
207 | struct tasklet_struct completion_tasklet; | 206 | struct tasklet_struct completion_tasklet; |
208 | struct list_head requests_to_complete; | 207 | struct list_head requests_to_complete; |
209 | struct list_head requests_to_errorback; | 208 | struct list_head requests_to_errorback; |
@@ -308,6 +307,11 @@ static inline struct isci_pci_info *to_pci_info(struct pci_dev *pdev) | |||
308 | return pci_get_drvdata(pdev); | 307 | return pci_get_drvdata(pdev); |
309 | } | 308 | } |
310 | 309 | ||
310 | static inline struct Scsi_Host *to_shost(struct isci_host *ihost) | ||
311 | { | ||
312 | return ihost->sas_ha.core.shost; | ||
313 | } | ||
314 | |||
311 | #define for_each_isci_host(id, ihost, pdev) \ | 315 | #define for_each_isci_host(id, ihost, pdev) \ |
312 | for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \ | 316 | for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \ |
313 | id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \ | 317 | id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \ |
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index eda43851cc98..fdae42f572b6 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c | |||
@@ -271,13 +271,12 @@ static void isci_unregister(struct isci_host *isci_host) | |||
271 | if (!isci_host) | 271 | if (!isci_host) |
272 | return; | 272 | return; |
273 | 273 | ||
274 | shost = isci_host->shost; | ||
275 | |||
276 | sas_unregister_ha(&isci_host->sas_ha); | 274 | sas_unregister_ha(&isci_host->sas_ha); |
277 | 275 | ||
278 | sas_remove_host(isci_host->shost); | 276 | shost = to_shost(isci_host); |
279 | scsi_remove_host(isci_host->shost); | 277 | sas_remove_host(shost); |
280 | scsi_host_put(isci_host->shost); | 278 | scsi_remove_host(shost); |
279 | scsi_host_put(shost); | ||
281 | } | 280 | } |
282 | 281 | ||
283 | static int __devinit isci_pci_init(struct pci_dev *pdev) | 282 | static int __devinit isci_pci_init(struct pci_dev *pdev) |
@@ -578,7 +577,6 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id) | |||
578 | shost = scsi_host_alloc(&isci_sht, sizeof(void *)); | 577 | shost = scsi_host_alloc(&isci_sht, sizeof(void *)); |
579 | if (!shost) | 578 | if (!shost) |
580 | return NULL; | 579 | return NULL; |
581 | ihost->shost = shost; | ||
582 | 580 | ||
583 | dev_info(&pdev->dev, "%sSCU controller %d: phy 3-0 cables: " | 581 | dev_info(&pdev->dev, "%sSCU controller %d: phy 3-0 cables: " |
584 | "{%s, %s, %s, %s}\n", | 582 | "{%s, %s, %s, %s}\n", |
@@ -690,11 +688,11 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic | |||
690 | pci_info->hosts[i] = h; | 688 | pci_info->hosts[i] = h; |
691 | 689 | ||
692 | /* turn on DIF support */ | 690 | /* turn on DIF support */ |
693 | scsi_host_set_prot(h->shost, | 691 | scsi_host_set_prot(to_shost(h), |
694 | SHOST_DIF_TYPE1_PROTECTION | | 692 | SHOST_DIF_TYPE1_PROTECTION | |
695 | SHOST_DIF_TYPE2_PROTECTION | | 693 | SHOST_DIF_TYPE2_PROTECTION | |
696 | SHOST_DIF_TYPE3_PROTECTION); | 694 | SHOST_DIF_TYPE3_PROTECTION); |
697 | scsi_host_set_guard(h->shost, SHOST_DIX_GUARD_CRC); | 695 | scsi_host_set_guard(to_shost(h), SHOST_DIX_GUARD_CRC); |
698 | } | 696 | } |
699 | 697 | ||
700 | err = isci_setup_interrupts(pdev); | 698 | err = isci_setup_interrupts(pdev); |
@@ -702,7 +700,7 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic | |||
702 | goto err_host_alloc; | 700 | goto err_host_alloc; |
703 | 701 | ||
704 | for_each_isci_host(i, isci_host, pdev) | 702 | for_each_isci_host(i, isci_host, pdev) |
705 | scsi_scan_host(isci_host->shost); | 703 | scsi_scan_host(to_shost(isci_host)); |
706 | 704 | ||
707 | return 0; | 705 | return 0; |
708 | 706 | ||