Skip to content

Commit

Permalink
of: dma: Make of_dma_deconfigure() public
Browse files Browse the repository at this point in the history
As part of moving DMA initializing to probe time the
of_dma_deconfigure() function will need to be called from different
source files. Make it public and move it to drivers/of/device.c where
the of_dma_configure() function is.

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Laurent Pinchart authored and Joerg Roedel committed Apr 20, 2017
1 parent d7b0558 commit 3f18667
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 12 additions & 0 deletions drivers/of/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ void of_dma_configure(struct device *dev, struct device_node *np)
}
EXPORT_SYMBOL_GPL(of_dma_configure);

/**
* of_dma_deconfigure - Clean up DMA configuration
* @dev: Device for which to clean up DMA configuration
*
* Clean up all configuration performed by of_dma_configure_ops() and free all
* resources that have been allocated.
*/
void of_dma_deconfigure(struct device *dev)
{
arch_teardown_dma_ops(dev);
}

int of_device_register(struct platform_device *pdev)
{
device_initialize(&pdev->dev);
Expand Down
5 changes: 0 additions & 5 deletions drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,6 @@ struct platform_device *of_device_alloc(struct device_node *np,
}
EXPORT_SYMBOL(of_device_alloc);

static void of_dma_deconfigure(struct device *dev)
{
arch_teardown_dma_ops(dev);
}

/**
* of_platform_device_create_pdata - Alloc, initialize and register an of_device
* @np: pointer to node to create device for
Expand Down
3 changes: 3 additions & 0 deletions include/linux/of_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ static inline struct device_node *of_cpu_device_node_get(int cpu)
}

void of_dma_configure(struct device *dev, struct device_node *np);
void of_dma_deconfigure(struct device *dev);
#else /* CONFIG_OF */

static inline int of_driver_match_device(struct device *dev,
Expand Down Expand Up @@ -105,6 +106,8 @@ static inline struct device_node *of_cpu_device_node_get(int cpu)
}
static inline void of_dma_configure(struct device *dev, struct device_node *np)
{}
static inline void of_dma_deconfigure(struct device *dev)
{}
#endif /* CONFIG_OF */

#endif /* _LINUX_OF_DEVICE_H */

0 comments on commit 3f18667

Please sign in to comment.