* [PATCH] gpio: pl061: Support building as module
@ 2020-04-09 1:41 Rob Herring
2020-04-14 14:24 ` Bartosz Golaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2020-04-09 1:41 UTC (permalink / raw)
To: Linus Walleij; +Cc: Bartosz Golaszewski, linux-gpio
Enable building the PL061 GPIO driver as a module.
This does change the initcall level when built-in. This shouldn't be a
problem as any user should support deferred probe by now. A scan of DT
based platforms at least didn't reveal any users that would be a
problem.
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/gpio/Kconfig | 2 +-
drivers/gpio/gpio-pl061.c | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index b8013cf90064..f1ef878f615b 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -422,7 +422,7 @@ config GPIO_OMAP
Say yes here to enable GPIO support for TI OMAP SoCs.
config GPIO_PL061
- bool "PrimeCell PL061 GPIO support"
+ tristate "PrimeCell PL061 GPIO support"
depends on ARM_AMBA
select IRQ_DOMAIN
select GPIOLIB_IRQCHIP
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 5df7782e348f..cf0d5e9b6f2c 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -16,6 +16,7 @@
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/irqchip/chained_irq.h>
+#include <linux/module.h>
#include <linux/bitops.h>
#include <linux/gpio/driver.h>
#include <linux/device.h>
@@ -413,6 +414,7 @@ static const struct amba_id pl061_ids[] = {
},
{ 0, 0 },
};
+MODULE_DEVICE_TABLE(amba, pl061_ids);
static struct amba_driver pl061_gpio_driver = {
.drv = {
@@ -424,9 +426,6 @@ static struct amba_driver pl061_gpio_driver = {
.id_table = pl061_ids,
.probe = pl061_probe,
};
+module_amba_driver(pl061_gpio_driver);
-static int __init pl061_gpio_init(void)
-{
- return amba_driver_register(&pl061_gpio_driver);
-}
-device_initcall(pl061_gpio_init);
+MODULE_LICENSE("GPL v2");
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio: pl061: Support building as module
2020-04-09 1:41 [PATCH] gpio: pl061: Support building as module Rob Herring
@ 2020-04-14 14:24 ` Bartosz Golaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2020-04-14 14:24 UTC (permalink / raw)
To: Rob Herring; +Cc: Linus Walleij, linux-gpio
czw., 9 kwi 2020 o 03:41 Rob Herring <robh@kernel.org> napisał(a):
>
> Enable building the PL061 GPIO driver as a module.
>
> This does change the initcall level when built-in. This shouldn't be a
> problem as any user should support deferred probe by now. A scan of DT
> based platforms at least didn't reveal any users that would be a
> problem.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Cc: linux-gpio@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> drivers/gpio/Kconfig | 2 +-
> drivers/gpio/gpio-pl061.c | 9 ++++-----
> 2 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index b8013cf90064..f1ef878f615b 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -422,7 +422,7 @@ config GPIO_OMAP
> Say yes here to enable GPIO support for TI OMAP SoCs.
>
> config GPIO_PL061
> - bool "PrimeCell PL061 GPIO support"
> + tristate "PrimeCell PL061 GPIO support"
> depends on ARM_AMBA
> select IRQ_DOMAIN
> select GPIOLIB_IRQCHIP
> diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
> index 5df7782e348f..cf0d5e9b6f2c 100644
> --- a/drivers/gpio/gpio-pl061.c
> +++ b/drivers/gpio/gpio-pl061.c
> @@ -16,6 +16,7 @@
> #include <linux/interrupt.h>
> #include <linux/irq.h>
> #include <linux/irqchip/chained_irq.h>
> +#include <linux/module.h>
> #include <linux/bitops.h>
> #include <linux/gpio/driver.h>
> #include <linux/device.h>
> @@ -413,6 +414,7 @@ static const struct amba_id pl061_ids[] = {
> },
> { 0, 0 },
> };
> +MODULE_DEVICE_TABLE(amba, pl061_ids);
>
> static struct amba_driver pl061_gpio_driver = {
> .drv = {
> @@ -424,9 +426,6 @@ static struct amba_driver pl061_gpio_driver = {
> .id_table = pl061_ids,
> .probe = pl061_probe,
> };
> +module_amba_driver(pl061_gpio_driver);
>
> -static int __init pl061_gpio_init(void)
> -{
> - return amba_driver_register(&pl061_gpio_driver);
> -}
> -device_initcall(pl061_gpio_init);
> +MODULE_LICENSE("GPL v2");
> --
> 2.20.1
>
Patch applied, thanks!
Bart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-14 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-09 1:41 [PATCH] gpio: pl061: Support building as module Rob Herring
2020-04-14 14:24 ` Bartosz Golaszewski
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).