[v2] gpio: davinci: add support of module build
Commit Message
From: Guillaume La Roque <glaroque@baylibre.com>
Added module build support for the davinci gpio driver
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Nicolas Frayer <nfrayer@baylibre.com>
---
v1->v2:
Keep postcore_initcall() instead of using module_init()
drivers/gpio/Kconfig | 2 +-
drivers/gpio/gpio-davinci.c | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
Comments
On Mon, Nov 7, 2022 at 6:29 PM Nicolas Frayer <nfrayer@baylibre.com> wrote:
>
> From: Guillaume La Roque <glaroque@baylibre.com>
>
> Added module build support for the davinci gpio driver
>
> Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
> Signed-off-by: Nicolas Frayer <nfrayer@baylibre.com>
> ---
Applied, thanks!
Bart
@@ -219,7 +219,7 @@ config GPIO_CLPS711X
Say yes here to support GPIO on CLPS711X SoCs.
config GPIO_DAVINCI
- bool "TI Davinci/Keystone GPIO support"
+ tristate "TI Davinci/Keystone GPIO support"
default y if ARCH_DAVINCI
depends on (ARM || ARM64) && (ARCH_DAVINCI || ARCH_KEYSTONE || ARCH_K3)
help
@@ -730,3 +730,14 @@ static int __init davinci_gpio_drv_reg(void)
return platform_driver_register(&davinci_gpio_driver);
}
postcore_initcall(davinci_gpio_drv_reg);
+
+static void __exit davinci_gpio_exit(void)
+{
+ platform_driver_unregister(&davinci_gpio_driver);
+}
+module_exit(davinci_gpio_exit);
+
+MODULE_AUTHOR("Jan Kotas <jank@cadence.com>");
+MODULE_DESCRIPTION("DAVINCI GPIO driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:gpio-davinci");