Skip to content

Commit 1136a02

Browse files
johnpgarrymartinkpetersen
authored andcommitted
scsi: libsas: Delete struct scsi_core
Since commit 79855d1 ("libsas: remove task_collector mode"), struct scsi_core only contains a reference to the shost. struct scsi_core is only used in sas_ha_struct.core, so delete scsi_core and replace with a reference to the shost there. Signed-off-by: John Garry <john.g.garry@oracle.com> Link: https://lore.kernel.org/r/20230815115156.343535-5-john.g.garry@oracle.com Reviewed-by: Jason Yan <yanaijie@huawei.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 2f4e20c commit 1136a02

File tree

17 files changed

+50
-55
lines changed

17 files changed

+50
-55
lines changed

drivers/scsi/aic94xx/aic94xx_hwi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static int asd_get_user_sas_addr(struct asd_ha_struct *asd_ha)
2828
if (asd_ha->hw_prof.sas_addr[0])
2929
return 0;
3030

31-
return sas_request_addr(asd_ha->sas_ha.core.shost,
31+
return sas_request_addr(asd_ha->sas_ha.shost,
3232
asd_ha->hw_prof.sas_addr);
3333
}
3434

drivers/scsi/aic94xx/aic94xx_init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,8 @@ static int asd_unregister_sas_ha(struct asd_ha_struct *asd_ha)
687687

688688
err = sas_unregister_ha(&asd_ha->sas_ha);
689689

690-
sas_remove_host(asd_ha->sas_ha.core.shost);
691-
scsi_host_put(asd_ha->sas_ha.core.shost);
690+
sas_remove_host(asd_ha->sas_ha.shost);
691+
scsi_host_put(asd_ha->sas_ha.shost);
692692

693693
kfree(asd_ha->sas_ha.sas_phy);
694694
kfree(asd_ha->sas_ha.sas_port);
@@ -738,7 +738,7 @@ static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
738738
asd_printk("found %s, device %s\n", asd_ha->name, pci_name(dev));
739739

740740
SHOST_TO_SAS_HA(shost) = &asd_ha->sas_ha;
741-
asd_ha->sas_ha.core.shost = shost;
741+
asd_ha->sas_ha.shost = shost;
742742
shost->transportt = aic94xx_transport_template;
743743
shost->max_id = ~0;
744744
shost->max_lun = ~0;

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,7 +2519,7 @@ int hisi_sas_probe(struct platform_device *pdev,
25192519
sha->dev = hisi_hba->dev;
25202520
sha->sas_addr = &hisi_hba->sas_addr[0];
25212521
sha->num_phys = hisi_hba->n_phy;
2522-
sha->core.shost = hisi_hba->shost;
2522+
sha->shost = hisi_hba->shost;
25232523

25242524
for (i = 0; i < hisi_hba->n_phy; i++) {
25252525
sha->sas_phy[i] = &hisi_hba->phy[i].sas_phy;
@@ -2561,12 +2561,12 @@ void hisi_sas_remove(struct platform_device *pdev)
25612561
{
25622562
struct sas_ha_struct *sha = platform_get_drvdata(pdev);
25632563
struct hisi_hba *hisi_hba = sha->lldd_ha;
2564-
struct Scsi_Host *shost = sha->core.shost;
2564+
struct Scsi_Host *shost = sha->shost;
25652565

25662566
del_timer_sync(&hisi_hba->timer);
25672567

25682568
sas_unregister_ha(sha);
2569-
sas_remove_host(sha->core.shost);
2569+
sas_remove_host(shost);
25702570

25712571
hisi_sas_free(hisi_hba);
25722572
scsi_host_put(shost);

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4950,7 +4950,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
49504950

49514951
sha->sas_phy = arr_phy;
49524952
sha->sas_port = arr_port;
4953-
sha->core.shost = shost;
4953+
sha->shost = shost;
49544954
sha->lldd_ha = hisi_hba;
49554955

49564956
shost->transportt = hisi_sas_stt;
@@ -5054,14 +5054,14 @@ static void hisi_sas_v3_remove(struct pci_dev *pdev)
50545054
struct device *dev = &pdev->dev;
50555055
struct sas_ha_struct *sha = dev_get_drvdata(dev);
50565056
struct hisi_hba *hisi_hba = sha->lldd_ha;
5057-
struct Scsi_Host *shost = sha->core.shost;
5057+
struct Scsi_Host *shost = sha->shost;
50585058

50595059
pm_runtime_get_noresume(dev);
50605060
del_timer_sync(&hisi_hba->timer);
50615061

50625062
sas_unregister_ha(sha);
50635063
flush_workqueue(hisi_hba->wq);
5064-
sas_remove_host(sha->core.shost);
5064+
sas_remove_host(shost);
50655065

50665066
hisi_sas_v3_destroy_irqs(pdev, hisi_hba);
50675067
hisi_sas_free(hisi_hba);

drivers/scsi/isci/host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static inline struct isci_pci_info *to_pci_info(struct pci_dev *pdev)
306306

307307
static inline struct Scsi_Host *to_shost(struct isci_host *ihost)
308308
{
309-
return ihost->sas_ha.core.shost;
309+
return ihost->sas_ha.shost;
310310
}
311311

312312
#define for_each_isci_host(id, ihost, pdev) \

drivers/scsi/isci/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id)
574574
goto err_shost;
575575

576576
SHOST_TO_SAS_HA(shost) = &ihost->sas_ha;
577-
ihost->sas_ha.core.shost = shost;
577+
ihost->sas_ha.shost = shost;
578578
shost->transportt = isci_transport_template;
579579

580580
shost->max_id = ~0;
@@ -729,7 +729,7 @@ static int isci_resume(struct device *dev)
729729
sas_prep_resume_ha(&ihost->sas_ha);
730730

731731
isci_host_init(ihost);
732-
isci_host_start(ihost->sas_ha.core.shost);
732+
isci_host_start(ihost->sas_ha.shost);
733733
wait_for_start(ihost);
734734

735735
sas_resume_ha(&ihost->sas_ha);

drivers/scsi/libsas/sas_ata.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
162162
struct ata_port *ap = qc->ap;
163163
struct domain_device *dev = ap->private_data;
164164
struct sas_ha_struct *sas_ha = dev->port->ha;
165-
struct Scsi_Host *host = sas_ha->core.shost;
165+
struct Scsi_Host *host = sas_ha->shost;
166166
struct sas_internal *i = to_sas_internal(host->transportt);
167167

168168
/* TODO: we should try to remove that unlock */
@@ -235,7 +235,7 @@ static void sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc)
235235

236236
static struct sas_internal *dev_to_sas_internal(struct domain_device *dev)
237237
{
238-
return to_sas_internal(dev->port->ha->core.shost->transportt);
238+
return to_sas_internal(dev->port->ha->shost->transportt);
239239
}
240240

241241
static int sas_get_ata_command_set(struct domain_device *dev)
@@ -584,7 +584,7 @@ static struct ata_port_info sata_port_info = {
584584
int sas_ata_init(struct domain_device *found_dev)
585585
{
586586
struct sas_ha_struct *ha = found_dev->port->ha;
587-
struct Scsi_Host *shost = ha->core.shost;
587+
struct Scsi_Host *shost = ha->shost;
588588
struct ata_host *ata_host;
589589
struct ata_port *ap;
590590
int rc;
@@ -822,7 +822,7 @@ static void async_sas_ata_eh(void *data, async_cookie_t cookie)
822822
struct sas_ha_struct *ha = dev->port->ha;
823823

824824
sas_ata_printk(KERN_DEBUG, dev, "dev error handler\n");
825-
ata_scsi_port_error_handler(ha->core.shost, ap);
825+
ata_scsi_port_error_handler(ha->shost, ap);
826826
sas_put_device(dev);
827827
}
828828

drivers/scsi/libsas/sas_discover.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ int sas_notify_lldd_dev_found(struct domain_device *dev)
170170
{
171171
int res = 0;
172172
struct sas_ha_struct *sas_ha = dev->port->ha;
173-
struct Scsi_Host *shost = sas_ha->core.shost;
173+
struct Scsi_Host *shost = sas_ha->shost;
174174
struct sas_internal *i = to_sas_internal(shost->transportt);
175175

176176
if (!i->dft->lldd_dev_found)
@@ -192,7 +192,7 @@ int sas_notify_lldd_dev_found(struct domain_device *dev)
192192
void sas_notify_lldd_dev_gone(struct domain_device *dev)
193193
{
194194
struct sas_ha_struct *sas_ha = dev->port->ha;
195-
struct Scsi_Host *shost = sas_ha->core.shost;
195+
struct Scsi_Host *shost = sas_ha->shost;
196196
struct sas_internal *i = to_sas_internal(shost->transportt);
197197

198198
if (!i->dft->lldd_dev_gone)
@@ -234,7 +234,7 @@ static void sas_suspend_devices(struct work_struct *work)
234234
struct domain_device *dev;
235235
struct sas_discovery_event *ev = to_sas_discovery_event(work);
236236
struct asd_sas_port *port = ev->port;
237-
struct Scsi_Host *shost = port->ha->core.shost;
237+
struct Scsi_Host *shost = port->ha->shost;
238238
struct sas_internal *si = to_sas_internal(shost->transportt);
239239

240240
clear_bit(DISCE_SUSPEND, &port->disc.pending);
@@ -373,7 +373,7 @@ static bool sas_abort_cmd(struct request *req, void *data)
373373
static void sas_abort_device_scsi_cmds(struct domain_device *dev)
374374
{
375375
struct sas_ha_struct *sas_ha = dev->port->ha;
376-
struct Scsi_Host *shost = sas_ha->core.shost;
376+
struct Scsi_Host *shost = sas_ha->shost;
377377

378378
if (dev_is_expander(dev->dev_type))
379379
return;

drivers/scsi/libsas/sas_expander.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static int smp_execute_task_sg(struct domain_device *dev,
3737
int res, retry;
3838
struct sas_task *task = NULL;
3939
struct sas_internal *i =
40-
to_sas_internal(dev->port->ha->core.shost->transportt);
40+
to_sas_internal(dev->port->ha->shost->transportt);
4141
struct sas_ha_struct *ha = dev->port->ha;
4242

4343
pm_runtime_get_sync(ha->dev);

drivers/scsi/libsas/sas_host_smp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int sas_host_smp_write_gpio(struct sas_ha_struct *sas_ha, u8 *resp_data,
114114
u8 reg_type, u8 reg_index, u8 reg_count,
115115
u8 *req_data)
116116
{
117-
struct sas_internal *i = to_sas_internal(sas_ha->core.shost->transportt);
117+
struct sas_internal *i = to_sas_internal(sas_ha->shost->transportt);
118118
int written;
119119

120120
if (i->dft->lldd_write_gpio == NULL) {
@@ -182,7 +182,7 @@ static void sas_phy_control(struct sas_ha_struct *sas_ha, u8 phy_id,
182182
enum sas_linkrate max, u8 *resp_data)
183183
{
184184
struct sas_internal *i =
185-
to_sas_internal(sas_ha->core.shost->transportt);
185+
to_sas_internal(sas_ha->shost->transportt);
186186
struct sas_phy_linkrates rates;
187187
struct asd_sas_phy *asd_phy;
188188

0 commit comments

Comments
 (0)