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

Commit 1e73692d authored by Prudhvi Yarlagadda's avatar Prudhvi Yarlagadda Committed by venkata manasa kakarla
Browse files

msm_geni_serial: Use the common driver API for dma_alloc



Use the common driver APIs instead of directly using
dma_alloc_coherent,dma_free_coherent APIs.
Issue is that we need to pass iommu dev as a handler
while using dma APIs where as we were passing common
driver dev node as a handler which is not correct.

Change-Id: Ia8da31f8b9d761a723b3712c7b0738e71838fa56
Signed-off-by: default avatarPrudhvi Yarlagadda <pyarlaga@codeaurora.org>
parent 2997c880
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -2083,9 +2083,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;
@@ -2134,8 +2134,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:
@@ -3215,8 +3215,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;