[RESEND PATCH] gpio: vf610: Allow building as a module

Jindong Yue posted 1 patch 1 month ago
There is a newer version of this series
drivers/gpio/Kconfig      | 2 +-
drivers/gpio/gpio-vf610.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
[RESEND PATCH] gpio: vf610: Allow building as a module
Posted by Jindong Yue 1 month ago
Support for building it as a module for use on the Android
platform, because the Android kernel(GKI) doesn't contain
board-specific drivers, it requires that these drivers
be built as a module and loaded into the system.

Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
---
 drivers/gpio/Kconfig      | 2 +-
 drivers/gpio/gpio-vf610.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index f2c39bbff83a..17127555f582 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -753,7 +753,7 @@ config GPIO_UNIPHIER
 	  Say yes here to support UniPhier GPIOs.
 
 config GPIO_VF610
-	bool "VF610 GPIO support"
+	tristate "VF610 GPIO support"
 	default y if SOC_VF610
 	depends on ARCH_MXC || COMPILE_TEST
 	select GPIOLIB_IRQCHIP
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index 4dad7ce0c4dc..ff2c95f03eea 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -346,3 +346,5 @@ static struct platform_driver vf610_gpio_driver = {
 };
 
 builtin_platform_driver(vf610_gpio_driver);
+MODULE_DESCRIPTION("VF610 GPIO driver");
+MODULE_LICENSE("GPL");
-- 
2.34.1
Re: [RESEND PATCH] gpio: vf610: Allow building as a module
Posted by Linus Walleij 3 weeks, 2 days ago
On Tue, Apr 8, 2025 at 5:15 PM Jindong Yue <jindong.yue@nxp.com> wrote:

> Support for building it as a module for use on the Android
> platform, because the Android kernel(GKI) doesn't contain
> board-specific drivers, it requires that these drivers
> be built as a module and loaded into the system.
>
> Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
(...)

>  builtin_platform_driver(vf610_gpio_driver);
> +MODULE_DESCRIPTION("VF610 GPIO driver");
> +MODULE_LICENSE("GPL");

You compile a builtin_platform_driver() and then claim this is
a module?

Switch the builtin_platform_driver() to module_platform_driver().

(Also make sure that removing the module actually works, please.)

Yours,
Linus Walleij