/* Map the capabilities and adapter info DMA buffers to avoid runtime failures. Return 1 on error, 0 on success.  */
static int map_persist_bufs(struct ibmvscsi_host_data *hostdata)
/* Map the capabilities and adapter info DMA buffers to avoid runtime failures. Return 1 on error, 0 on success.  */
static int map_persist_bufs(struct ibmvscsi_host_data *hostdata)
{
	hostdata->caps_addr = dma_map_single(hostdata->dev, &hostdata->caps,
					     sizeof(hostdata->caps), DMA_BIDIRECTIONAL);
	if (dma_mapping_error(hostdata->dev, hostdata->caps_addr)) {
		dev_err(hostdata->dev, "Unable to map capabilities buffer!\n");
		return 1;
	}
	hostdata->adapter_info_addr = dma_map_single(hostdata->dev,
						     &hostdata->madapter_info,
						     sizeof(hostdata->madapter_info),
						     DMA_BIDIRECTIONAL);
	if (dma_mapping_error(hostdata->dev, hostdata->adapter_info_addr)) {
		dev_err(hostdata->dev, "Unable to map adapter info buffer!\n");
		dma_unmap_single(hostdata->dev, hostdata->caps_addr,
				 sizeof(hostdata->caps), DMA_BIDIRECTIONAL);
		return 1;
	}
	return 0;
}