From 66a4210bc82e024e6de0f94298ad9230984a5924 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 17 Jul 2023 08:37:17 -0600 Subject: of: Move of_device_{add,register,unregister} to platform.c The declarations for of_device_{add,register,unregister} were moved into of_platform.h, so the implementations should be moved to platform.c as well. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230717143718.1715773-2-robh@kernel.org Signed-off-by: Rob Herring --- drivers/of/device.c | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'drivers/of/device.c') diff --git a/drivers/of/device.c b/drivers/of/device.c index 0f00f1b80708..2319e0e73048 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -32,25 +32,6 @@ const struct of_device_id *of_match_device(const struct of_device_id *matches, } EXPORT_SYMBOL(of_match_device); -int of_device_add(struct platform_device *ofdev) -{ - BUG_ON(ofdev->dev.of_node == NULL); - - /* name and id have to be set so that the platform bus doesn't get - * confused on matching */ - ofdev->name = dev_name(&ofdev->dev); - ofdev->id = PLATFORM_DEVID_NONE; - - /* - * If this device has not binding numa node in devicetree, that is - * of_node_to_nid returns NUMA_NO_NODE. device_add will assume that this - * device is on the same node as the parent. - */ - set_dev_node(&ofdev->dev, of_node_to_nid(ofdev->dev.of_node)); - - return device_add(&ofdev->dev); -} - static void of_dma_set_restricted_buffer(struct device *dev, struct device_node *np) { @@ -221,19 +202,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, } EXPORT_SYMBOL_GPL(of_dma_configure_id); -int of_device_register(struct platform_device *pdev) -{ - device_initialize(&pdev->dev); - return of_device_add(pdev); -} -EXPORT_SYMBOL(of_device_register); - -void of_device_unregister(struct platform_device *ofdev) -{ - device_unregister(&ofdev->dev); -} -EXPORT_SYMBOL(of_device_unregister); - const void *of_device_get_match_data(const struct device *dev) { const struct of_device_id *match; -- cgit v1.2.3