treewide: zephyr: add sof_ prefix to dma_get/put() and struct dma#10090
Merged
kv2019i merged 1 commit intothesofproject:mainfrom Jul 4, 2025
Merged
Conversation
Add "sof_" namespace to dma_get()/put() in the Zephyr native drivers builds. The main "struct dma" is also renamed, so this touches quite many places in code. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
There was a problem hiding this comment.
Pull Request Overview
This PR renames the Zephyr DMA structures and functions by adding a sof_ prefix to avoid naming conflicts with native drivers.
- Renamed
struct dmatostruct sof_dmathroughout the codebase. - Updated
sof_dma_get/sof_dma_putfunction signatures and calls. - Adjusted DMA array definitions and cache initialization casts for the new type.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| zephyr/lib/dma.c | Renamed struct dma dma[] to struct sof_dma dma[]. |
| zephyr/include/sof/lib/dma.h | Updated DMA type declarations and prototypes to use sof_dma. |
| src/platform/posix/dma.c | Changed posix_sof_dma array and initializers to struct sof_dma. |
| src/platform/imx8m/lib/dma.c | Updated cache initialization cast for renamed DMA type. |
| src/library_manager/lib_manager.c | Updated lib_manager_dma_ext to reference struct sof_dma. |
| src/lib/dma.c | Refactored DMA init/get/put functions to use struct sof_dma. |
| src/ipc/ipc3/host-page-table.c | Adjusted signature of ipc_get_page_descriptors to use sof_dma. |
| src/include/sof/lib/dai-zephyr.h | Updated DMA pointer in struct dai_data to struct sof_dma. |
| src/include/sof/ipc/common.h | Conditional DMA type in ipc_data_host_buffer now uses sof_dma. |
| src/audio/copier/host_copier.h | Conditional DMA field now uses struct sof_dma. |
| src/audio/chain_dma.c | Renamed dma_host/dma_link fields to use struct sof_dma. |
|
|
||
| static const struct dma_info lib_dma = { | ||
| .dma_array = cache_to_uncache_init((struct dma *)dma), | ||
| .dma_array = cache_to_uncache_init((void *)dma), |
There was a problem hiding this comment.
[nitpick] Consider casting directly to struct sof_dma * instead of void * to preserve type safety and clarity (e.g., cache_to_uncache_init((struct sof_dma *)dma)).
Suggested change
| .dma_array = cache_to_uncache_init((void *)dma), | |
| .dma_array = cache_to_uncache_init((struct sof_dma *)dma), |
Member
|
@lyakh pls review |
lyakh
approved these changes
Jul 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add "sof_" namespace to dma_get()/put() in the Zephyr native drivers builds. The main "struct dma" is also renamed, so this touches quite many places in code.
V2 of #9728. Now that XTOS code is removed (see #9983 ), this is now a very simple patch. No need for ugly typedefs anymore.
I ketp the NATIVE_DRIVERS bits still in the codebase, but that's obviously the next bit that can be removed (along with dai-legacy.c and host-legacy.c -- and their dependencies).