libata: Add helper ata_shost_to_port()
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c
index b518654..c31b13f 100644
--- a/drivers/scsi/libata-eh.c
+++ b/drivers/scsi/libata-eh.c
@@ -64,7 +64,7 @@
enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd)
{
struct Scsi_Host *host = cmd->device->host;
- struct ata_port *ap = (struct ata_port *) &host->hostdata[0];
+ struct ata_port *ap = ata_shost_to_port(host);
unsigned long flags;
struct ata_queued_cmd *qc;
enum scsi_eh_timer_return ret = EH_HANDLED;
@@ -99,7 +99,7 @@
*/
void ata_scsi_error(struct Scsi_Host *host)
{
- struct ata_port *ap = (struct ata_port *)&host->hostdata[0];
+ struct ata_port *ap = ata_shost_to_port(host);
DPRINTK("ENTER\n");