Commit 5d86e479193b ("clocksource/drivers/exynos_mct: Add module support") introduced section mismatch failures. Commit 7e477e9c4eb4 ("clocksource/drivers/exynos_mct: Fix section mismatch from the module conversion") replaced these to other section mismatch failures: WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x164 (section: .text) -> register_current_timer_delay (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x20c (section: .text) -> register_current_timer_delay (section: .init.text) ERROR: modpost: Section mismatches detected. No progress on real fixing of these happened (intermediary fix was still not tested), so revert both commits till the work is prepared correctly. Fixes: 7e477e9c4eb4 ("clocksource/drivers/exynos_mct: Fix section mismatch from the module conversion") Fixes: 5d86e479193b ("clocksource/drivers/exynos_mct: Add module support") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> --- First build failure: https://krzk.eu/#/builders/12/builds/3350 --- drivers/clocksource/Kconfig | 3 +- drivers/clocksource/exynos_mct.c | 51 ++++++-------------------------- 2 files changed, 10 insertions(+), 44 deletions(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index d657c8ddc96b..645f517a1ac2 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -451,8 +451,7 @@ config ATMEL_TCB_CLKSRC Support for Timer Counter Blocks on Atmel SoCs. config CLKSRC_EXYNOS_MCT - tristate "Exynos multi core timer driver" if ARM64 - default y if ARCH_EXYNOS || COMPILE_TEST + bool "Exynos multi core timer driver" if COMPILE_TEST depends on ARM || ARM64 depends on ARCH_ARTPEC || ARCH_EXYNOS || COMPILE_TEST help diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 80d263ee046d..62febeb4e1de 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -15,11 +15,9 @@ #include <linux/cpu.h> #include <linux/delay.h> #include <linux/percpu.h> -#include <linux/module.h> #include <linux/of.h> #include <linux/of_irq.h> #include <linux/of_address.h> -#include <linux/platform_device.h> #include <linux/clocksource.h> #include <linux/sched_clock.h> @@ -219,7 +217,6 @@ static struct clocksource mct_frc = { .mask = CLOCKSOURCE_MASK(32), .flags = CLOCK_SOURCE_IS_CONTINUOUS, .resume = exynos4_frc_resume, - .owner = THIS_MODULE, }; /* @@ -244,7 +241,7 @@ static cycles_t exynos4_read_current_timer(void) } #endif -static int exynos4_clocksource_init(bool frc_shared) +static int __init exynos4_clocksource_init(bool frc_shared) { /* * When the frc is shared, the main processor should have already @@ -339,7 +336,6 @@ static struct clock_event_device mct_comp_device = { .set_state_oneshot = mct_set_state_shutdown, .set_state_oneshot_stopped = mct_set_state_shutdown, .tick_resume = mct_set_state_shutdown, - .owner = THIS_MODULE, }; static irqreturn_t exynos4_mct_comp_isr(int irq, void *dev_id) @@ -480,7 +476,6 @@ static int exynos4_mct_starting_cpu(unsigned int cpu) evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERCPU; evt->rating = MCT_CLKEVENTS_RATING; - evt->owner = THIS_MODULE; exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); @@ -516,7 +511,7 @@ static int exynos4_mct_dying_cpu(unsigned int cpu) return 0; } -static int exynos4_timer_resources(struct device_node *np) +static int __init exynos4_timer_resources(struct device_node *np) { struct clk *mct_clk, *tick_clk; @@ -544,7 +539,7 @@ static int exynos4_timer_resources(struct device_node *np) * @local_idx: array mapping CPU numbers to local timer indices * @nr_local: size of @local_idx array */ -static int exynos4_timer_interrupts(struct device_node *np, +static int __init exynos4_timer_interrupts(struct device_node *np, unsigned int int_type, const u32 *local_idx, size_t nr_local) @@ -657,7 +652,7 @@ static int exynos4_timer_interrupts(struct device_node *np, return err; } -static __init_or_module int mct_init_dt(struct device_node *np, unsigned int int_type) +static int __init mct_init_dt(struct device_node *np, unsigned int int_type) { bool frc_shared = of_property_read_bool(np, "samsung,frc-shared"); u32 local_idx[MCT_NR_LOCAL] = {0}; @@ -705,43 +700,15 @@ static __init_or_module int mct_init_dt(struct device_node *np, unsigned int int return exynos4_clockevent_init(); } -static __init_or_module int mct_init_spi(struct device_node *np) + +static int __init mct_init_spi(struct device_node *np) { return mct_init_dt(np, MCT_INT_SPI); } -static __init_or_module int mct_init_ppi(struct device_node *np) +static int __init mct_init_ppi(struct device_node *np) { return mct_init_dt(np, MCT_INT_PPI); } - -static int exynos4_mct_probe(struct platform_device *pdev) -{ - struct device *dev = &pdev->dev; - int (*mct_init)(struct device_node *np); - - mct_init = of_device_get_match_data(dev); - if (!mct_init) - return -EINVAL; - - return mct_init(dev->of_node); -} - -static const struct of_device_id exynos4_mct_match_table[] = { - { .compatible = "samsung,exynos4210-mct", .data = &mct_init_spi, }, - { .compatible = "samsung,exynos4412-mct", .data = &mct_init_ppi, }, - {} -}; -MODULE_DEVICE_TABLE(of, exynos4_mct_match_table); - -static struct platform_driver exynos4_mct_driver = { - .probe = exynos4_mct_probe, - .driver = { - .name = "exynos-mct", - .of_match_table = exynos4_mct_match_table, - }, -}; -module_platform_driver(exynos4_mct_driver); - -MODULE_DESCRIPTION("Exynos Multi Core Timer Driver"); -MODULE_LICENSE("GPL"); +TIMER_OF_DECLARE(exynos4210, "samsung,exynos4210-mct", mct_init_spi); +TIMER_OF_DECLARE(exynos4412, "samsung,exynos4412-mct", mct_init_ppi); -- 2.48.1