From: Aaron Kling Date: Wed, 2 Jul 2025 18:22:51 +0000 (-0500) Subject: gpio: palmas: Allow building as a module X-Git-Tag: block-6.17-20250808~23^2~104 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=cfbbf275ffcf05c82994b8787b0d1974aa1569d8;p=linux-block.git gpio: palmas: Allow building as a module 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 Link: https://lore.kernel.org/r/20250702-gpio-palmas-gpio-v4-1-26ba48252f27@gmail.com Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index b552401e3f73..6802e549621b 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -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 diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c index a076daee0065..9329d8ce8f59 100644 --- a/drivers/gpio/gpio-palmas.c +++ b/drivers/gpio/gpio-palmas.c @@ -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 "); +MODULE_LICENSE("GPL");