/* RETURNS: Matching xfer_shift, -1 if no match found.  */
int ata_xfer_mode2shift(unsigned long xfer_mode)
/* RETURNS: Matching xfer_shift, -1 if no match found.  */
int ata_xfer_mode2shift(unsigned long xfer_mode)
{
	const struct ata_xfer_ent *ent;
	for (ent = ata_xfer_tbl; ent->shift >= 0; ent++)
		if (xfer_mode >= ent->base && xfer_mode < ent->base + ent->bits)
			return ent->shift;
	return -1;
}