/* If the device was a SATA device, this function frees the libata ATA port, else it does nothing.  */
static void ipr_target_destroy(struct scsi_target *starget)
/* If the device was a SATA device, this function frees the libata ATA port, else it does nothing.  */
static void ipr_target_destroy(struct scsi_target *starget)
{
	struct ipr_sata_port *sata_port = starget->hostdata;
	if (sata_port) {
		starget->hostdata = NULL;
		ata_sas_port_destroy(sata_port->ap);
		kfree(sata_port);
	}
}