Re: [PATCH v2] gpio: palmas: Allow building as a module
From: Bartosz Golaszewski
Date: Tue Jul 01 2025 - 04:37:43 EST
On Mon, 30 Jun 2025 21:33:07 +0200, Aaron Kling <webgeek1234@xxxxxxxxx> said:
>>
>> This being put into an earlier initcall than device_initcall() makes
>> me think, someone had a reason for it and this change can break this.
>> I'm Cc'ing the original author who seems to still be active in the
>> kernel.
>>
>> Laxman: can you verify that this can be safely moved to module_initcall()?
>>
>
> Reminder about this patch/question. It's well into the 6.16 cycle now.
> If Laxman doesn't respond, is this mergeable? I didn't see any issues
> in my basic boot tests on a tegra124 device using a tps65913. But I
> didn't do anything close to full functionality tests.
>
Why not do the following?
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 44f922e10db2..dcea3c1bb31c 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -1501,7 +1501,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..ec503b008d0d 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,7 @@ static int __init palmas_gpio_init(void)
return platform_driver_register(&palmas_gpio_driver);
}
subsys_initcall(palmas_gpio_init);
+
+MODULE_DESCRIPTION("TI PALMAS series GPIO driver");
+MODULE_AUTHOR("Laxman Dewangan <ldewangan@xxxxxxxxxx>");
+MODULE_LICENSE("GPL");
This would keep the initcall level when the module is built-in.
Bartosz