2022-05-23 08:49:51

by Genjian

[permalink] [raw]
Subject: [PATCH] irq: mips: Export irq_err_count to modules

From: huhai <[email protected]>

modpost complains once these drivers become modules.
ERROR: modpost: "irq_err_count" [drivers/gpio/gpio-vr41xx.ko] undefined!

Fix it by export them when that symbol is =m.

Fixes: 27fdd325dace ("MIPS: Update VR41xx GPIO driver to use gpiolib")
Reported-by: k2ci <[email protected]>
Signed-off-by: huhai <[email protected]>
---
arch/mips/kernel/irq.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 5e11582fe308..b0038b715008 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -38,6 +38,9 @@ void ack_bad_irq(unsigned int irq)
}

atomic_t irq_err_count;
+#ifdef CONFIG_GPIO_VR41XX_MODULE
+EXPORT_SYMBOL_GPL(irq_err_count);
+#endif

int arch_show_interrupts(struct seq_file *p, int prec)
{
--
2.27.0



2022-05-23 09:36:48

by Thomas Bogendoerfer

[permalink] [raw]
Subject: Re: [PATCH] irq: mips: Export irq_err_count to modules

On Mon, May 23, 2022 at 04:16:25PM +0800, Genjian Zhang wrote:
> From: huhai <[email protected]>
>
> modpost complains once these drivers become modules.
> ERROR: modpost: "irq_err_count" [drivers/gpio/gpio-vr41xx.ko] undefined!
>
> Fix it by export them when that symbol is =m.
>
> Fixes: 27fdd325dace ("MIPS: Update VR41xx GPIO driver to use gpiolib")
> Reported-by: k2ci <[email protected]>
> Signed-off-by: huhai <[email protected]>
> ---
> arch/mips/kernel/irq.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
> index 5e11582fe308..b0038b715008 100644
> --- a/arch/mips/kernel/irq.c
> +++ b/arch/mips/kernel/irq.c
> @@ -38,6 +38,9 @@ void ack_bad_irq(unsigned int irq)
> }
>
> atomic_t irq_err_count;
> +#ifdef CONFIG_GPIO_VR41XX_MODULE
> +EXPORT_SYMBOL_GPL(irq_err_count);
> +#endif

please use spurious_interrupt() in drivers/gpio/gpio-vr41xx.c.

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]