stm32-usart.c (217b04c67b6bca03a484bf8cad44596a34a9de4c) stm32-usart.c (59bd4eedf118a0404631038ece6f6a436b98c256)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) Maxime Coquelin 2015
4 * Copyright (C) STMicroelectronics SA 2017
5 * Authors: Maxime Coquelin <mcoquelin.stm32@gmail.com>
6 * Gerald Baeza <gerald.baeza@foss.st.com>
7 * Erwan Le Ray <erwan.leray@foss.st.com>
8 *

--- 1163 unchanged lines hidden (view full) ---

1172
1173 /*
1174 * Using DMA and threaded handler for the console could lead to
1175 * deadlocks.
1176 */
1177 if (uart_console(port))
1178 return -ENODEV;
1179
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) Maxime Coquelin 2015
4 * Copyright (C) STMicroelectronics SA 2017
5 * Authors: Maxime Coquelin <mcoquelin.stm32@gmail.com>
6 * Gerald Baeza <gerald.baeza@foss.st.com>
7 * Erwan Le Ray <erwan.leray@foss.st.com>
8 *

--- 1163 unchanged lines hidden (view full) ---

1172
1173 /*
1174 * Using DMA and threaded handler for the console could lead to
1175 * deadlocks.
1176 */
1177 if (uart_console(port))
1178 return -ENODEV;
1179
1180 stm32port->rx_buf = dma_alloc_coherent(&pdev->dev, RX_BUF_L,
1180 stm32port->rx_buf = dma_alloc_coherent(dev, RX_BUF_L,
1181 &stm32port->rx_dma_buf,
1182 GFP_KERNEL);
1183 if (!stm32port->rx_buf)
1184 return -ENOMEM;
1185
1186 /* Configure DMA channel */
1187 memset(&config, 0, sizeof(config));
1188 config.src_addr = port->mapbase + ofs->rdr;

--- 49 unchanged lines hidden (view full) ---

1238 const struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
1239 struct uart_port *port = &stm32port->port;
1240 struct device *dev = &pdev->dev;
1241 struct dma_slave_config config;
1242 int ret;
1243
1244 stm32port->tx_dma_busy = false;
1245
1181 &stm32port->rx_dma_buf,
1182 GFP_KERNEL);
1183 if (!stm32port->rx_buf)
1184 return -ENOMEM;
1185
1186 /* Configure DMA channel */
1187 memset(&config, 0, sizeof(config));
1188 config.src_addr = port->mapbase + ofs->rdr;

--- 49 unchanged lines hidden (view full) ---

1238 const struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
1239 struct uart_port *port = &stm32port->port;
1240 struct device *dev = &pdev->dev;
1241 struct dma_slave_config config;
1242 int ret;
1243
1244 stm32port->tx_dma_busy = false;
1245
1246 stm32port->tx_buf = dma_alloc_coherent(&pdev->dev, TX_BUF_L,
1246 stm32port->tx_buf = dma_alloc_coherent(dev, TX_BUF_L,
1247 &stm32port->tx_dma_buf,
1248 GFP_KERNEL);
1249 if (!stm32port->tx_buf)
1250 return -ENOMEM;
1251
1252 /* Configure DMA channel */
1253 memset(&config, 0, sizeof(config));
1254 config.dst_addr = port->mapbase + ofs->tdr;

--- 379 unchanged lines hidden ---
1247 &stm32port->tx_dma_buf,
1248 GFP_KERNEL);
1249 if (!stm32port->tx_buf)
1250 return -ENOMEM;
1251
1252 /* Configure DMA channel */
1253 memset(&config, 0, sizeof(config));
1254 config.dst_addr = port->mapbase + ofs->tdr;

--- 379 unchanged lines hidden ---