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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Jason Yan <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
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

drivers/scsi/libsas/sas_init.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static int sas_get_linkerrors(struct sas_phy *phy)
183183
struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost);
184184
struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];
185185
struct sas_internal *i =
186-
to_sas_internal(sas_ha->core.shost->transportt);
186+
to_sas_internal(sas_ha->shost->transportt);
187187

188188
return i->dft->lldd_control_phy(asd_phy, PHY_FUNC_GET_EVENTS, NULL);
189189
}
@@ -232,7 +232,7 @@ static int transport_sas_phy_reset(struct sas_phy *phy, int hard_reset)
232232
struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost);
233233
struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];
234234
struct sas_internal *i =
235-
to_sas_internal(sas_ha->core.shost->transportt);
235+
to_sas_internal(sas_ha->shost->transportt);
236236

237237
if (!hard_reset && sas_try_ata_reset(asd_phy) == 0)
238238
return 0;
@@ -266,7 +266,7 @@ int sas_phy_enable(struct sas_phy *phy, int enable)
266266
struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost);
267267
struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];
268268
struct sas_internal *i =
269-
to_sas_internal(sas_ha->core.shost->transportt);
269+
to_sas_internal(sas_ha->shost->transportt);
270270

271271
if (enable)
272272
ret = transport_sas_phy_reset(phy, 0);
@@ -303,7 +303,7 @@ int sas_phy_reset(struct sas_phy *phy, int hard_reset)
303303
struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost);
304304
struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];
305305
struct sas_internal *i =
306-
to_sas_internal(sas_ha->core.shost->transportt);
306+
to_sas_internal(sas_ha->shost->transportt);
307307

308308
ret = i->dft->lldd_control_phy(asd_phy, reset_type, NULL);
309309
} else {
@@ -339,7 +339,7 @@ int sas_set_phy_speed(struct sas_phy *phy,
339339
struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost);
340340
struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];
341341
struct sas_internal *i =
342-
to_sas_internal(sas_ha->core.shost->transportt);
342+
to_sas_internal(sas_ha->shost->transportt);
343343

344344
ret = i->dft->lldd_control_phy(asd_phy, PHY_FUNC_SET_LINK_RATE,
345345
rates);
@@ -438,7 +438,7 @@ static void _sas_resume_ha(struct sas_ha_struct *ha, bool drain)
438438
/* all phys are back up or timed out, turn on i/o so we can
439439
* flush out disks that did not return
440440
*/
441-
scsi_unblock_requests(ha->core.shost);
441+
scsi_unblock_requests(ha->shost);
442442
if (drain)
443443
sas_drain_work(ha);
444444
clear_bit(SAS_HA_RESUMING, &ha->state);
@@ -468,7 +468,7 @@ void sas_suspend_ha(struct sas_ha_struct *ha)
468468
int i;
469469

470470
sas_disable_events(ha);
471-
scsi_block_requests(ha->core.shost);
471+
scsi_block_requests(ha->shost);
472472
for (i = 0; i < ha->num_phys; i++) {
473473
struct asd_sas_port *port = ha->sas_port[i];
474474

@@ -641,7 +641,7 @@ struct asd_sas_event *sas_alloc_event(struct asd_sas_phy *phy,
641641
struct asd_sas_event *event;
642642
struct sas_ha_struct *sas_ha = phy->ha;
643643
struct sas_internal *i =
644-
to_sas_internal(sas_ha->core.shost->transportt);
644+
to_sas_internal(sas_ha->shost->transportt);
645645

646646
event = kmem_cache_zalloc(sas_event_cache, gfp_flags);
647647
if (!event)

drivers/scsi/libsas/sas_phy.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static void sas_phye_oob_error(struct work_struct *work)
3838
struct sas_ha_struct *sas_ha = phy->ha;
3939
struct asd_sas_port *port = phy->port;
4040
struct sas_internal *i =
41-
to_sas_internal(sas_ha->core.shost->transportt);
41+
to_sas_internal(sas_ha->shost->transportt);
4242

4343
sas_deform_port(phy, 1);
4444

@@ -66,7 +66,7 @@ static void sas_phye_spinup_hold(struct work_struct *work)
6666
struct asd_sas_phy *phy = ev->phy;
6767
struct sas_ha_struct *sas_ha = phy->ha;
6868
struct sas_internal *i =
69-
to_sas_internal(sas_ha->core.shost->transportt);
69+
to_sas_internal(sas_ha->shost->transportt);
7070

7171
phy->error = 0;
7272
i->dft->lldd_control_phy(phy, PHY_FUNC_RELEASE_SPINUP_HOLD, NULL);
@@ -95,7 +95,7 @@ static void sas_phye_shutdown(struct work_struct *work)
9595
struct asd_sas_phy *phy = ev->phy;
9696
struct sas_ha_struct *sas_ha = phy->ha;
9797
struct sas_internal *i =
98-
to_sas_internal(sas_ha->core.shost->transportt);
98+
to_sas_internal(sas_ha->shost->transportt);
9999

100100
if (phy->enabled) {
101101
int ret;
@@ -131,7 +131,7 @@ int sas_register_phys(struct sas_ha_struct *sas_ha)
131131
spin_lock_init(&phy->sas_prim_lock);
132132
phy->frame_rcvd_size = 0;
133133

134-
phy->phy = sas_phy_alloc(&sas_ha->core.shost->shost_gendev, i);
134+
phy->phy = sas_phy_alloc(&sas_ha->shost->shost_gendev, i);
135135
if (!phy->phy)
136136
return -ENOMEM;
137137

drivers/scsi/libsas/sas_port.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static void sas_resume_port(struct asd_sas_phy *phy)
2828
struct domain_device *dev, *n;
2929
struct asd_sas_port *port = phy->port;
3030
struct sas_ha_struct *sas_ha = phy->ha;
31-
struct sas_internal *si = to_sas_internal(sas_ha->core.shost->transportt);
31+
struct sas_internal *si = to_sas_internal(sas_ha->shost->transportt);
3232

3333
if (si->dft->lldd_port_formed)
3434
si->dft->lldd_port_formed(phy);
@@ -108,7 +108,7 @@ static void sas_form_port(struct asd_sas_phy *phy)
108108
struct asd_sas_port *port = phy->port;
109109
struct domain_device *port_dev = NULL;
110110
struct sas_internal *si =
111-
to_sas_internal(sas_ha->core.shost->transportt);
111+
to_sas_internal(sas_ha->shost->transportt);
112112
unsigned long flags;
113113

114114
if (port) {
@@ -211,7 +211,7 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone)
211211
struct sas_ha_struct *sas_ha = phy->ha;
212212
struct asd_sas_port *port = phy->port;
213213
struct sas_internal *si =
214-
to_sas_internal(sas_ha->core.shost->transportt);
214+
to_sas_internal(sas_ha->shost->transportt);
215215
struct domain_device *dev;
216216
unsigned long flags;
217217

0 commit comments

Comments
 (0)