/* Returns the slot id for a device that resides inside an enclosure.  */
static int _transport_get_bay_identifier(struct sas_rphy *rphy)
/* Returns the slot id for a device that resides inside an enclosure.  */
static int _transport_get_bay_identifier(struct sas_rphy *rphy)
{
	struct MPT2SAS_ADAPTER *ioc = rphy_to_ioc(rphy);
	struct _sas_device *sas_device;
	unsigned long flags;
	spin_lock_irqsave(&ioc->sas_device_lock, flags);
	sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc,
	    rphy->identify.sas_address);
	spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
	if (!sas_device)
		return -ENXIO;
	return sas_device->slot;
}