Message ID | 20190529104312.27835-1-l.stach@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] mm: cma: export functions to get CMA base and size | expand |
On Wed, May 29, 2019 at 12:43:11PM +0200, Lucas Stach wrote: > Make them usable in modules. Some drivers want to know where their > device CMA area is located to make better decisions about the DMA > programming. NAK. This is very much a layering violation. At very least you'd need to wire this up through the DMA API and deal with dma_addr_t addresses instead of physical addresses, which are opaque to DMA using drivers. But even for that we'd need a really good rationale.
diff --git a/mm/cma.c b/mm/cma.c index 3340ef34c154..191c89bf038d 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -44,11 +44,13 @@ phys_addr_t cma_get_base(const struct cma *cma) { return PFN_PHYS(cma->base_pfn); } +EXPORT_SYMBOL_GPL(cma_get_base); unsigned long cma_get_size(const struct cma *cma) { return cma->count << PAGE_SHIFT; } +EXPORT_SYMBOL_GPL(cma_get_size); const char *cma_get_name(const struct cma *cma) {
Make them usable in modules. Some drivers want to know where their device CMA area is located to make better decisions about the DMA programming. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> --- mm/cma.c | 2 ++ 1 file changed, 2 insertions(+)