Commit 12f8c553 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Stephen Boyd

clk: sunxi-ng: replace lib-y with obj-y

We had commit 06e226c7 ("clk: sunxi-ng: Move all clock types to a
library") and commit 799c4341 ("kbuild: thin archives make default
for all archs") in the same development cycle, from different trees.

With migration to the thin archive, the entire drivers/clk/sunxi-ng/lib.a
is linked to the vmlinux.  This does not break build, but we do not get
any size saving.

However, we do not need to go back to the individual Kconfig options.
The default configuration pulls in all (or most) of the CCU parts anyway.
Also, once we enable CONFIG_LD_DEAD_CODE_DATA_ELIMINATION, we can simply
list all files with obj-y, and the linker will drop all unused functions
by itself.

After the long discussion [1], people there agreed to fix this, but
nobody sent a patch after all.  I am doing it now.

I lifted up CONFIG_SUNXI_CCU to drivers/clk/Makefile because everything
in drivers/clk/sunxi-ng/ depends on SUNXI_CCU.

[1] https://patchwork.kernel.org/patch/9796521/Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: default avatarStephen Boyd <sboyd@kernel.org>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent ce397d21
...@@ -96,7 +96,7 @@ obj-$(CONFIG_ARCH_SPRD) += sprd/ ...@@ -96,7 +96,7 @@ obj-$(CONFIG_ARCH_SPRD) += sprd/
obj-$(CONFIG_ARCH_STI) += st/ obj-$(CONFIG_ARCH_STI) += st/
obj-$(CONFIG_ARCH_STRATIX10) += socfpga/ obj-$(CONFIG_ARCH_STRATIX10) += socfpga/
obj-$(CONFIG_ARCH_SUNXI) += sunxi/ obj-$(CONFIG_ARCH_SUNXI) += sunxi/
obj-$(CONFIG_ARCH_SUNXI) += sunxi-ng/ obj-$(CONFIG_SUNXI_CCU) += sunxi-ng/
obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-$(CONFIG_ARCH_TEGRA) += tegra/
obj-y += ti/ obj-y += ti/
obj-$(CONFIG_CLK_UNIPHIER) += uniphier/ obj-$(CONFIG_CLK_UNIPHIER) += uniphier/
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Common objects # Common objects
lib-$(CONFIG_SUNXI_CCU) += ccu_common.o obj-y += ccu_common.o
lib-$(CONFIG_SUNXI_CCU) += ccu_mmc_timing.o obj-y += ccu_mmc_timing.o
lib-$(CONFIG_SUNXI_CCU) += ccu_reset.o obj-y += ccu_reset.o
# Base clock types # Base clock types
lib-$(CONFIG_SUNXI_CCU) += ccu_div.o obj-y += ccu_div.o
lib-$(CONFIG_SUNXI_CCU) += ccu_frac.o obj-y += ccu_frac.o
lib-$(CONFIG_SUNXI_CCU) += ccu_gate.o obj-y += ccu_gate.o
lib-$(CONFIG_SUNXI_CCU) += ccu_mux.o obj-y += ccu_mux.o
lib-$(CONFIG_SUNXI_CCU) += ccu_mult.o obj-y += ccu_mult.o
lib-$(CONFIG_SUNXI_CCU) += ccu_phase.o obj-y += ccu_phase.o
lib-$(CONFIG_SUNXI_CCU) += ccu_sdm.o obj-y += ccu_sdm.o
# Multi-factor clocks # Multi-factor clocks
lib-$(CONFIG_SUNXI_CCU) += ccu_nk.o obj-y += ccu_nk.o
lib-$(CONFIG_SUNXI_CCU) += ccu_nkm.o obj-y += ccu_nkm.o
lib-$(CONFIG_SUNXI_CCU) += ccu_nkmp.o obj-y += ccu_nkmp.o
lib-$(CONFIG_SUNXI_CCU) += ccu_nm.o obj-y += ccu_nm.o
lib-$(CONFIG_SUNXI_CCU) += ccu_mp.o obj-y += ccu_mp.o
# SoC support # SoC support
obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o
...@@ -38,12 +38,3 @@ obj-$(CONFIG_SUN8I_R40_CCU) += ccu-sun8i-r40.o ...@@ -38,12 +38,3 @@ obj-$(CONFIG_SUN8I_R40_CCU) += ccu-sun8i-r40.o
obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80.o
obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-de.o
obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o obj-$(CONFIG_SUN9I_A80_CCU) += ccu-sun9i-a80-usb.o
# The lib-y file goals is supposed to work only in arch/*/lib or lib/. In our
# case, we want to use that goal, but even though lib.a will be properly
# generated, it will not be linked in, eventually resulting in a linker error
# for missing symbols.
#
# We can work around that by explicitly adding lib.a to the obj-y goal. This is
# an undocumented behaviour, but works well for now.
obj-$(CONFIG_SUNXI_CCU) += lib.a
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment