/* Check if the current speed of the device requires IORDY. Used by various controllers for chip configuration.  */
unsigned int ata_pio_need_iordy(const struct ata_device *adev)
/* Check if the current speed of the device requires IORDY. Used by various controllers for chip configuration.  */
unsigned int ata_pio_need_iordy(const struct ata_device *adev)
{
	if (adev->link->ap->pflags & ATA_PFLAG_RESETTING)
		return 0;
	if (adev->link->ap->flags & ATA_FLAG_NO_IORDY)
		return 0;
	if (ata_id_is_cfa(adev->id)
	    && (adev->pio_mode == XFER_PIO_5 || adev->pio_mode == XFER_PIO_6))
		return 0;
	if (adev->pio_mode > XFER_PIO_2)
		return 1;
	if (ata_id_has_iordy(adev->id))
		return 1;
	return 0;
}