/* ps3stor_teardown - Tear down a storage device after use @dev: Pointer to a struct ps3_storage_device  */
void ps3stor_teardown(struct ps3_storage_device *dev)
/* ps3stor_teardown - Tear down a storage device after use @dev: Pointer to a struct ps3_storage_device  */
void ps3stor_teardown(struct ps3_storage_device *dev)
{
	int error;
	dma_unmap_single(&dev->sbd.core, dev->bounce_dma, dev->bounce_size,
			 DMA_BIDIRECTIONAL);
	ps3_dma_region_free(&dev->dma_region);
	free_irq(dev->irq, dev);
	error = ps3_sb_event_receive_port_destroy(&dev->sbd, dev->irq);
	if (error)
		dev_err(&dev->sbd.core,
			"%s:%u: destroy event receive port failed %d\n",
			__func__, __LINE__, error);
	error = ps3stor_close_hv_device(&dev->sbd);
	if (error)
		dev_err(&dev->sbd.core,
			"%s:%u: ps3_close_hv_device failed %d\n", __func__,
			__LINE__, error);
}