aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index d1dfe872ee30..95e6159b44cf 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1381,6 +1381,21 @@ static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
1381 return *(struct ata_port **)&host->hostdata[0]; 1381 return *(struct ata_port **)&host->hostdata[0];
1382} 1382}
1383 1383
1384static inline int ata_check_ready(u8 status)
1385{
1386 /* Some controllers report 0x77 or 0x7f during intermediate
1387 * not-ready stages.
1388 */
1389 if (status == 0x77 || status == 0x7f)
1390 return 0;
1391
1392 /* 0xff indicates either no device or device not ready */
1393 if (status == 0xff)
1394 return -ENODEV;
1395
1396 return !(status & ATA_BUSY);
1397}
1398
1384 1399
1385/************************************************************************** 1400/**************************************************************************
1386 * PMP - drivers/ata/libata-pmp.c 1401 * PMP - drivers/ata/libata-pmp.c