Commit 459a87f4 authored by Vit Stanicek's avatar Vit Stanicek Committed by Henrik Brix Andersen
Browse files

tests: test_dma_loop: Release DMA channels upon use



Release DMA channels allocated through dma_request_channel with
dma_release_channel in test_loop, test_loop_suspend_resume and
test_loop_repeated_start_stop.

This prevents channel allocation leaks and enables the tests to still
run even if the utilised DMA driver is configured to only utilise a
subset of implemented DMA channels.

Signed-off-by: default avatarVit Stanicek <vit.stanicek@nxp.com>
parent 1c0ae3cc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -169,6 +169,8 @@ static int test_loop(const struct device *dma)
		}
	}

	dma_release_channel(dma, chan_id);

	TC_PRINT("Finished DMA: %s\n", dma->name);
	return TC_PASS;
}
@@ -314,6 +316,8 @@ static int test_loop_suspend_resume(const struct device *dma)
		}
	}

	dma_release_channel(dma, chan_id);

	TC_PRINT("Finished DMA: %s\n", dma->name);
	return TC_PASS;
}
@@ -468,6 +472,8 @@ static int test_loop_repeated_start_stop(const struct device *dma)
		return TC_FAIL;
	}

	dma_release_channel(dma, chan_id);

	return TC_PASS;
}