]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpio: palmas: Allow building as a module
authorAaron Kling <webgeek1234@gmail.com>
Wed, 2 Jul 2025 18:22:51 +0000 (13:22 -0500)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 3 Jul 2025 08:37:04 +0000 (10:37 +0200)
The driver works fine as a module, so allowing building as such. This
adds an exit handler to support module unload.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Link: https://lore.kernel.org/r/20250702-gpio-palmas-gpio-v4-1-26ba48252f27@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/Kconfig
drivers/gpio/gpio-palmas.c

index b552401e3f73fbf30c95fc438cc8b7a93e0f2c3a..6802e549621b281fbe178cba83d2c53bb2cfab23 100644 (file)
@@ -1502,7 +1502,7 @@ config GPIO_MAX77759
          called gpio-max77759.
 
 config GPIO_PALMAS
-       bool "TI PALMAS series PMICs GPIO"
+       tristate "TI PALMAS series PMICs GPIO"
        depends on MFD_PALMAS
        help
          Select this option to enable GPIO driver for the TI PALMAS
index a076daee00658a9e423a0d78f14ad48d61956d7a..9329d8ce8f59842cfe95f41b85c8e5ea6bf440b8 100644 (file)
@@ -139,6 +139,7 @@ static const struct of_device_id of_palmas_gpio_match[] = {
        { .compatible = "ti,tps80036-gpio", .data = &tps80036_dev_data,},
        { },
 };
+MODULE_DEVICE_TABLE(of, of_palmas_gpio_match);
 
 static int palmas_gpio_probe(struct platform_device *pdev)
 {
@@ -196,3 +197,13 @@ static int __init palmas_gpio_init(void)
        return platform_driver_register(&palmas_gpio_driver);
 }
 subsys_initcall(palmas_gpio_init);
+
+static void __exit palmas_gpio_exit(void)
+{
+       platform_driver_unregister(&palmas_gpio_driver);
+}
+module_exit(palmas_gpio_exit);
+
+MODULE_DESCRIPTION("TI PALMAS series GPIO driver");
+MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
+MODULE_LICENSE("GPL");