summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2022-03-10 14:50:11 +0800
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2022-03-14 15:09:02 +0100
commitcd04d58e829dd074b0af1c1556c5130227f9f23a (patch)
tree7ac2e451502985f4dca5eb252e2f087ea5852b96
parent89fa1268932420c64155bb4de9a9252a8c9e475d (diff)
MIPS: Remove redundant definitions of device_tree_init()
There exists many same definitions of device_tree_init() for various platforms, add a weak function in arch/mips/kernel/prom.c to clean up the related code. Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-rw-r--r--arch/mips/ath79/setup.c5
-rw-r--r--arch/mips/kernel/prom.c5
-rw-r--r--arch/mips/lantiq/prom.c5
-rw-r--r--arch/mips/loongson64/setup.c5
-rw-r--r--arch/mips/mti-malta/Makefile1
-rw-r--r--arch/mips/mti-malta/malta-dt.c15
-rw-r--r--arch/mips/pic32/pic32mzda/init.c5
-rw-r--r--arch/mips/ralink/of.c5
8 files changed, 5 insertions, 41 deletions
diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
index 45d4d717e47c..4e18cdcf65a0 100644
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
@@ -269,8 +269,3 @@ void __init arch_init_irq(void)
{
irqchip_init();
}
-
-void __init device_tree_init(void)
-{
- unflatten_and_copy_device_tree();
-}
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
index 6abebd57b218..7db6ff9aed7d 100644
--- a/arch/mips/kernel/prom.c
+++ b/arch/mips/kernel/prom.c
@@ -64,4 +64,9 @@ int __init __dt_register_buses(const char *bus0, const char *bus1)
return 0;
}
+void __weak __init device_tree_init(void)
+{
+ unflatten_and_copy_device_tree();
+}
+
#endif
diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c
index bc9f58fcbdf9..c731082a0c42 100644
--- a/arch/mips/lantiq/prom.c
+++ b/arch/mips/lantiq/prom.c
@@ -84,11 +84,6 @@ void __init plat_mem_setup(void)
__dt_setup_arch(dtb);
}
-void __init device_tree_init(void)
-{
- unflatten_and_copy_device_tree();
-}
-
void __init prom_init(void)
{
/* call the soc specific detetcion code and get it to fill soc_info */
diff --git a/arch/mips/loongson64/setup.c b/arch/mips/loongson64/setup.c
index 1973eb091e10..3cd11c2b308b 100644
--- a/arch/mips/loongson64/setup.c
+++ b/arch/mips/loongson64/setup.c
@@ -36,8 +36,3 @@ void __init plat_mem_setup(void)
if (loongson_fdt_blob)
__dt_setup_arch(loongson_fdt_blob);
}
-
-void __init device_tree_init(void)
-{
- unflatten_and_copy_device_tree();
-}
diff --git a/arch/mips/mti-malta/Makefile b/arch/mips/mti-malta/Makefile
index 94c11f5eac74..13bbd12bfa65 100644
--- a/arch/mips/mti-malta/Makefile
+++ b/arch/mips/mti-malta/Makefile
@@ -6,7 +6,6 @@
# Copyright (C) 2008 Wind River Systems, Inc.
# written by Ralf Baechle <ralf@linux-mips.org>
#
-obj-y += malta-dt.o
obj-y += malta-dtshim.o
obj-y += malta-init.o
obj-y += malta-int.o
diff --git a/arch/mips/mti-malta/malta-dt.c b/arch/mips/mti-malta/malta-dt.c
deleted file mode 100644
index d045c9149418..000000000000
--- a/arch/mips/mti-malta/malta-dt.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Copyright (C) 2015 Imagination Technologies
- * Author: Paul Burton <paul.burton@mips.com>
- */
-
-#include <linux/clk-provider.h>
-#include <linux/init.h>
-#include <linux/of_fdt.h>
-#include <linux/of_platform.h>
-
-void __init device_tree_init(void)
-{
- unflatten_and_copy_device_tree();
-}
diff --git a/arch/mips/pic32/pic32mzda/init.c b/arch/mips/pic32/pic32mzda/init.c
index a1860f2138dc..129915616763 100644
--- a/arch/mips/pic32/pic32mzda/init.c
+++ b/arch/mips/pic32/pic32mzda/init.c
@@ -78,11 +78,6 @@ void __init prom_init(void)
pic32_init_cmdline((int)fw_arg0, (char **)fw_arg1);
}
-void __init device_tree_init(void)
-{
- unflatten_and_copy_device_tree();
-}
-
static struct pic32_sdhci_platform_data sdhci_data = {
.setup_dma = pic32_set_sdhci_adma_fifo_threshold,
};
diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
index 35a87a2da10b..587c7b998769 100644
--- a/arch/mips/ralink/of.c
+++ b/arch/mips/ralink/of.c
@@ -48,11 +48,6 @@ __iomem void *plat_of_remap_node(const char *node)
return ioremap(res.start, resource_size(&res));
}
-void __init device_tree_init(void)
-{
- unflatten_and_copy_device_tree();
-}
-
void __init plat_mem_setup(void)
{
void *dtb;