* [PATCH v3] gpio: palmas: Allow building as a module
@ 2025-07-02 5:56 Aaron Kling via B4 Relay
2025-07-02 9:12 ` Bartosz Golaszewski
0 siblings, 1 reply; 3+ messages in thread
From: Aaron Kling via B4 Relay @ 2025-07-02 5:56 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski; +Cc: linux-gpio, linux-kernel, Aaron Kling
From: Aaron Kling <webgeek1234@gmail.com>
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>
---
Changes in v3:
- Drop use of module init macro and add exit handler
- Link to v2: https://lore.kernel.org/r/20250522-gpio-palmas-gpio-v2-1-89f209d4a949@gmail.com
Changes in v2:
- Drop module alias and add module device table
- Link to v1: https://lore.kernel.org/r/20250522-gpio-palmas-gpio-v1-1-d6b1a3776ef5@gmail.com
---
drivers/gpio/Kconfig | 2 +-
drivers/gpio/gpio-palmas.c | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index f2c39bbff83a33dcb12b2d32aa3ebc358a0dd949..be5d823516d0e2bff4b4231dac6a82bf10887118 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -1464,7 +1464,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
diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
index 28dba7048509a3ef9c7972c1be53ea30adddabb0..232b3ac52b3362c33ea8b068d5932f682816a5e4 100644
--- a/drivers/gpio/gpio-palmas.c
+++ b/drivers/gpio/gpio-palmas.c
@@ -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");
---
base-commit: b36ddb9210e6812eb1c86ad46b66cc46aa193487
change-id: 20250520-gpio-palmas-gpio-a99fc046dc7f
Best regards,
--
Aaron Kling <webgeek1234@gmail.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] gpio: palmas: Allow building as a module
2025-07-02 5:56 [PATCH v3] gpio: palmas: Allow building as a module Aaron Kling via B4 Relay
@ 2025-07-02 9:12 ` Bartosz Golaszewski
2025-07-02 18:24 ` Aaron Kling
0 siblings, 1 reply; 3+ messages in thread
From: Bartosz Golaszewski @ 2025-07-02 9:12 UTC (permalink / raw)
To: webgeek1234; +Cc: Linus Walleij, linux-gpio, linux-kernel
On Wed, Jul 2, 2025 at 7:56 AM Aaron Kling via B4 Relay
<devnull+webgeek1234.gmail.com@kernel.org> wrote:
>
> From: Aaron Kling <webgeek1234@gmail.com>
>
> 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 doesn't apply on top of linux-next.
Bart
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] gpio: palmas: Allow building as a module
2025-07-02 9:12 ` Bartosz Golaszewski
@ 2025-07-02 18:24 ` Aaron Kling
0 siblings, 0 replies; 3+ messages in thread
From: Aaron Kling @ 2025-07-02 18:24 UTC (permalink / raw)
To: Bartosz Golaszewski; +Cc: Linus Walleij, linux-gpio, linux-kernel
On Wed, Jul 2, 2025 at 4:12 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> On Wed, Jul 2, 2025 at 7:56 AM Aaron Kling via B4 Relay
> <devnull+webgeek1234.gmail.com@kernel.org> wrote:
> >
> > From: Aaron Kling <webgeek1234@gmail.com>
> >
> > 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 doesn't apply on top of linux-next.
Sent a v4 rebased on next-20250702. It rebased cleanly though, so I
don't know why it wouldn't apply for you.
Aaron
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-02 18:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 5:56 [PATCH v3] gpio: palmas: Allow building as a module Aaron Kling via B4 Relay
2025-07-02 9:12 ` Bartosz Golaszewski
2025-07-02 18:24 ` Aaron Kling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).