Skip to content

Commit

Permalink
swiotlb: fix implicit debugfs declarations
Browse files Browse the repository at this point in the history
Factor out the debugfs bits from rmem_swiotlb_device_init() into a separate
rmem_swiotlb_debugfs_init() to fix the implicit debugfs declarations.

Fixes: 4610218 ("swiotlb: Add restricted DMA pool initialization")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Claire Chang <tientzu@chromium.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Claire Chang authored and Konrad Rzeszutek Wilk committed Jul 14, 2021
1 parent fec9b62 commit 09a4a79
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions kernel/dma/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,21 @@ late_initcall(swiotlb_create_default_debugfs);
#endif

#ifdef CONFIG_DMA_RESTRICTED_POOL

#ifdef CONFIG_DEBUG_FS
static void rmem_swiotlb_debugfs_init(struct reserved_mem *rmem)
{
struct io_tlb_mem *mem = rmem->priv;

mem->debugfs = debugfs_create_dir(rmem->name, debugfs_dir);
swiotlb_create_debugfs_files(mem);
}
#else
static void rmem_swiotlb_debugfs_init(struct reserved_mem *rmem)
{
}
#endif

struct page *swiotlb_alloc(struct device *dev, size_t size)
{
struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
Expand Down Expand Up @@ -766,11 +781,7 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,

rmem->priv = mem;

if (IS_ENABLED(CONFIG_DEBUG_FS)) {
mem->debugfs =
debugfs_create_dir(rmem->name, debugfs_dir);
swiotlb_create_debugfs_files(mem);
}
rmem_swiotlb_debugfs_init(rmem);
}

dev->dma_io_tlb_mem = mem;
Expand Down

0 comments on commit 09a4a79

Please sign in to comment.