Skip to content

Commit 3b91eaa

Browse files
committed
drivers: remove on-stack copying of dma cfg on stm32 drivers
This change removes the on-stack copying and instead uses a pointer to the configuration to avoid unnecessary stack usage Signed-off-by: Mario Paja <[email protected]>
1 parent 1a49b41 commit 3b91eaa

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

drivers/flash/flash_stm32_ospi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2242,7 +2242,7 @@ static int flash_stm32_ospi_init(const struct device *dev)
22422242
* the minimum information to inform the DMA slot will be in used and
22432243
* how to route callbacks.
22442244
*/
2245-
struct dma_config dma_cfg = dev_data->dma.cfg;
2245+
struct dma_config *dma_cfg = &dev_data->dma.cfg;
22462246
static DMA_HandleTypeDef hdma;
22472247

22482248
if (!device_is_ready(dev_data->dma.dev)) {

drivers/flash/flash_stm32_qspi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ static int flash_stm32_qspi_init(const struct device *dev)
15581558
* the minimum information to inform the DMA slot will be in used and
15591559
* how to route callbacks.
15601560
*/
1561-
struct dma_config dma_cfg = dev_data->dma.cfg;
1561+
struct dma_config *dma_cfg = &dev_data->dma.cfg;
15621562
static DMA_HandleTypeDef hdma;
15631563

15641564
if (!device_is_ready(dev_data->dma.dev)) {

drivers/i2s/i2s_stm32_sai.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static int i2s_stm32_sai_dma_init(const struct device *dev)
279279
{
280280
struct i2s_stm32_sai_data *dev_data = dev->data;
281281
struct stream *stream = &dev_data->stream;
282-
struct dma_config dma_cfg = dev_data->stream.dma_cfg;
282+
struct dma_config *dma_cfg = &dev_data->stream.dma_cfg
283283
int ret;
284284

285285
SAI_HandleTypeDef *hsai = &dev_data->hsai;

drivers/video/video_stm32_dcmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static int stm32_dma_init(const struct device *dev)
147147
* the minimum information to inform the DMA slot will be in used and
148148
* how to route callbacks.
149149
*/
150-
struct dma_config dma_cfg = config->dma.cfg;
150+
struct dma_config *dma_cfg = &config->dma.cfg;
151151
static DMA_HandleTypeDef hdma;
152152

153153
/* Proceed to the minimum Zephyr DMA driver init */

0 commit comments

Comments
 (0)