serial: stm32: use the defined variable to simplify code
authorTang Bin <tangbin@cmss.chinamobile.com>
Sat, 14 Aug 2021 12:49:51 +0000 (20:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Aug 2021 16:52:59 +0000 (18:52 +0200)
Use the defined variable 'dev' to make the code cleaner.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210814124951.30084-1-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/stm32-usart.c

index 090822cd1604598455b01e6af5b8c79af9b186fd..99f9038dda5dae4eeb4736277b435aa2d19867ce 100644 (file)
@@ -1177,7 +1177,7 @@ static int stm32_usart_of_dma_rx_probe(struct stm32_port *stm32port,
        if (uart_console(port))
                return -ENODEV;
 
-       stm32port->rx_buf = dma_alloc_coherent(&pdev->dev, RX_BUF_L,
+       stm32port->rx_buf = dma_alloc_coherent(dev, RX_BUF_L,
                                               &stm32port->rx_dma_buf,
                                               GFP_KERNEL);
        if (!stm32port->rx_buf)
@@ -1243,7 +1243,7 @@ static int stm32_usart_of_dma_tx_probe(struct stm32_port *stm32port,
 
        stm32port->tx_dma_busy = false;
 
-       stm32port->tx_buf = dma_alloc_coherent(&pdev->dev, TX_BUF_L,
+       stm32port->tx_buf = dma_alloc_coherent(dev, TX_BUF_L,
                                               &stm32port->tx_dma_buf,
                                               GFP_KERNEL);
        if (!stm32port->tx_buf)