aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-scsi.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-04-11 13:12:34 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-11 13:12:34 -0400
commit35bb94b116e1fd4959ef0d3187458b5820eac8c4 (patch)
tree48a05166c489838d04429279a2886ac6a32b20c9 /drivers/scsi/libata-scsi.c
parent381544bba3ae6f2f1004b267da34f840b469033c (diff)
libata: Add helper ata_shost_to_port()
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r--drivers/scsi/libata-scsi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 5ae7613bc157..9871f8272df0 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -395,7 +395,7 @@ void ata_dump_status(unsigned id, struct ata_taskfile *tf)
395 395
396int ata_scsi_device_resume(struct scsi_device *sdev) 396int ata_scsi_device_resume(struct scsi_device *sdev)
397{ 397{
398 struct ata_port *ap = (struct ata_port *) &sdev->host->hostdata[0]; 398 struct ata_port *ap = ata_shost_to_port(sdev->host);
399 struct ata_device *dev = &ap->device[sdev->id]; 399 struct ata_device *dev = &ap->device[sdev->id];
400 400
401 return ata_device_resume(ap, dev); 401 return ata_device_resume(ap, dev);
@@ -403,7 +403,7 @@ int ata_scsi_device_resume(struct scsi_device *sdev)
403 403
404int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t state) 404int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t state)
405{ 405{
406 struct ata_port *ap = (struct ata_port *) &sdev->host->hostdata[0]; 406 struct ata_port *ap = ata_shost_to_port(sdev->host);
407 struct ata_device *dev = &ap->device[sdev->id]; 407 struct ata_device *dev = &ap->device[sdev->id];
408 408
409 return ata_device_suspend(ap, dev, state); 409 return ata_device_suspend(ap, dev, state);
@@ -704,7 +704,7 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
704 struct ata_port *ap; 704 struct ata_port *ap;
705 struct ata_device *dev; 705 struct ata_device *dev;
706 706
707 ap = (struct ata_port *) &sdev->host->hostdata[0]; 707 ap = ata_shost_to_port(sdev->host);
708 dev = &ap->device[sdev->id]; 708 dev = &ap->device[sdev->id];
709 709
710 ata_scsi_dev_config(sdev, dev); 710 ata_scsi_dev_config(sdev, dev);
@@ -2478,7 +2478,7 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
2478 struct scsi_device *scsidev = cmd->device; 2478 struct scsi_device *scsidev = cmd->device;
2479 struct Scsi_Host *shost = scsidev->host; 2479 struct Scsi_Host *shost = scsidev->host;
2480 2480
2481 ap = (struct ata_port *) &shost->hostdata[0]; 2481 ap = ata_shost_to_port(shost);
2482 2482
2483 spin_unlock(shost->host_lock); 2483 spin_unlock(shost->host_lock);
2484 spin_lock(&ap->host_set->lock); 2484 spin_lock(&ap->host_set->lock);