Commit d1dc5e2d authored by Dan Williams's avatar Dan Williams

isci: kill isci_host.shost

We can retrieve the shost from the sas_ha like the rest of libsas and
drop this out of our local data structure.
Acked-by: default avatarJacek Danecki <jacek.danecki@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 2396a265
...@@ -203,7 +203,6 @@ struct isci_host { ...@@ -203,7 +203,6 @@ struct isci_host {
#define IHOST_IRQ_ENABLED 2 #define IHOST_IRQ_ENABLED 2
unsigned long flags; unsigned long flags;
wait_queue_head_t eventq; wait_queue_head_t eventq;
struct Scsi_Host *shost;
struct tasklet_struct completion_tasklet; struct tasklet_struct completion_tasklet;
struct list_head requests_to_complete; struct list_head requests_to_complete;
struct list_head requests_to_errorback; struct list_head requests_to_errorback;
...@@ -308,6 +307,11 @@ static inline struct isci_pci_info *to_pci_info(struct pci_dev *pdev) ...@@ -308,6 +307,11 @@ static inline struct isci_pci_info *to_pci_info(struct pci_dev *pdev)
return pci_get_drvdata(pdev); return pci_get_drvdata(pdev);
} }
static inline struct Scsi_Host *to_shost(struct isci_host *ihost)
{
return ihost->sas_ha.core.shost;
}
#define for_each_isci_host(id, ihost, pdev) \ #define for_each_isci_host(id, ihost, pdev) \
for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \ for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \
id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \ id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \
......
...@@ -271,13 +271,12 @@ static void isci_unregister(struct isci_host *isci_host) ...@@ -271,13 +271,12 @@ static void isci_unregister(struct isci_host *isci_host)
if (!isci_host) if (!isci_host)
return; return;
shost = isci_host->shost;
sas_unregister_ha(&isci_host->sas_ha); sas_unregister_ha(&isci_host->sas_ha);
sas_remove_host(isci_host->shost); shost = to_shost(isci_host);
scsi_remove_host(isci_host->shost); sas_remove_host(shost);
scsi_host_put(isci_host->shost); scsi_remove_host(shost);
scsi_host_put(shost);
} }
static int __devinit isci_pci_init(struct pci_dev *pdev) 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,7 +577,6 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id)
shost = scsi_host_alloc(&isci_sht, sizeof(void *)); shost = scsi_host_alloc(&isci_sht, sizeof(void *));
if (!shost) if (!shost)
return NULL; return NULL;
ihost->shost = shost;
dev_info(&pdev->dev, "%sSCU controller %d: phy 3-0 cables: " dev_info(&pdev->dev, "%sSCU controller %d: phy 3-0 cables: "
"{%s, %s, %s, %s}\n", "{%s, %s, %s, %s}\n",
...@@ -690,11 +688,11 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic ...@@ -690,11 +688,11 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic
pci_info->hosts[i] = h; pci_info->hosts[i] = h;
/* turn on DIF support */ /* turn on DIF support */
scsi_host_set_prot(h->shost, scsi_host_set_prot(to_shost(h),
SHOST_DIF_TYPE1_PROTECTION | SHOST_DIF_TYPE1_PROTECTION |
SHOST_DIF_TYPE2_PROTECTION | SHOST_DIF_TYPE2_PROTECTION |
SHOST_DIF_TYPE3_PROTECTION); SHOST_DIF_TYPE3_PROTECTION);
scsi_host_set_guard(h->shost, SHOST_DIX_GUARD_CRC); scsi_host_set_guard(to_shost(h), SHOST_DIX_GUARD_CRC);
} }
err = isci_setup_interrupts(pdev); err = isci_setup_interrupts(pdev);
...@@ -702,7 +700,7 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic ...@@ -702,7 +700,7 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic
goto err_host_alloc; goto err_host_alloc;
for_each_isci_host(i, isci_host, pdev) for_each_isci_host(i, isci_host, pdev)
scsi_scan_host(isci_host->shost); scsi_scan_host(to_shost(isci_host));
return 0; return 0;
......
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