Skip to content

Commit 09a4a79

Browse files
Claire Changkonradwilk
authored andcommitted
swiotlb: fix implicit debugfs declarations
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 <[email protected]> Signed-off-by: Claire Chang <[email protected]> Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
1 parent fec9b62 commit 09a4a79

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

kernel/dma/swiotlb.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,21 @@ late_initcall(swiotlb_create_default_debugfs);
712712
#endif
713713

714714
#ifdef CONFIG_DMA_RESTRICTED_POOL
715+
716+
#ifdef CONFIG_DEBUG_FS
717+
static void rmem_swiotlb_debugfs_init(struct reserved_mem *rmem)
718+
{
719+
struct io_tlb_mem *mem = rmem->priv;
720+
721+
mem->debugfs = debugfs_create_dir(rmem->name, debugfs_dir);
722+
swiotlb_create_debugfs_files(mem);
723+
}
724+
#else
725+
static void rmem_swiotlb_debugfs_init(struct reserved_mem *rmem)
726+
{
727+
}
728+
#endif
729+
715730
struct page *swiotlb_alloc(struct device *dev, size_t size)
716731
{
717732
struct io_tlb_mem *mem = dev->dma_io_tlb_mem;
@@ -766,11 +781,7 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
766781

767782
rmem->priv = mem;
768783

769-
if (IS_ENABLED(CONFIG_DEBUG_FS)) {
770-
mem->debugfs =
771-
debugfs_create_dir(rmem->name, debugfs_dir);
772-
swiotlb_create_debugfs_files(mem);
773-
}
784+
rmem_swiotlb_debugfs_init(rmem);
774785
}
775786

776787
dev->dma_io_tlb_mem = mem;

0 commit comments

Comments
 (0)