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 <webgeek1234@gmail.com>
This commit is contained in:
Aaron Kling
2025-05-20 19:30:25 -05:00
committed by Thomas Makin
parent 49a0bd6704
commit 07b857abe5
2 changed files with 12 additions and 1 deletions

View File

@@ -1451,7 +1451,7 @@ config GPIO_MAX77650
These chips have a single pin that can be configured as GPIO.
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

View File

@@ -140,6 +140,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)
{
@@ -197,3 +198,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");