Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e58dfec0 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm_geni_serial: Use the common driver API for dma_alloc"

parents fa910f89 1e73692d
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -2084,9 +2084,9 @@ static int msm_geni_serial_port_setup(struct uart_port *uport)
			goto exit_portsetup;
		}

		msm_port->rx_buf = dma_alloc_coherent(msm_port->wrapper_dev,
				DMA_RX_BUF_SIZE, &dma_address, GFP_KERNEL);

		msm_port->rx_buf =
			geni_se_iommu_alloc_buf(msm_port->wrapper_dev,
				&dma_address, DMA_RX_BUF_SIZE);
		if (!msm_port->rx_buf) {
			devm_kfree(uport->dev, msm_port->rx_fifo);
			msm_port->rx_fifo = NULL;
@@ -2135,8 +2135,8 @@ static int msm_geni_serial_port_setup(struct uart_port *uport)
	return 0;
free_dma:
	if (msm_port->rx_dma) {
		dma_free_coherent(msm_port->wrapper_dev, DMA_RX_BUF_SIZE,
					msm_port->rx_buf, msm_port->rx_dma);
		geni_se_iommu_free_buf(msm_port->wrapper_dev,
			&msm_port->rx_dma, msm_port->rx_buf, DMA_RX_BUF_SIZE);
		msm_port->rx_dma = (dma_addr_t)NULL;
	}
exit_portsetup:
@@ -3217,8 +3217,8 @@ static int msm_geni_serial_remove(struct platform_device *pdev)
	wakeup_source_trash(&port->geni_wake);
	uart_remove_one_port(drv, &port->uport);
	if (port->rx_dma) {
		dma_free_coherent(port->wrapper_dev, DMA_RX_BUF_SIZE,
					port->rx_buf, port->rx_dma);
		geni_se_iommu_free_buf(port->wrapper_dev, &port->rx_dma,
					port->rx_buf, DMA_RX_BUF_SIZE);
		port->rx_dma = (dma_addr_t)NULL;
	}
	return 0;