gpio: pl061: Support building as module

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>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This commit is contained in:
Rob Herring 2020-04-08 19:41:10 -06:00 коммит произвёл Bartosz Golaszewski
Родитель 85a94ff8fb
Коммит 616844408d
2 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -422,7 +422,7 @@ config GPIO_OMAP
Say yes here to enable GPIO support for TI OMAP SoCs. Say yes here to enable GPIO support for TI OMAP SoCs.
config GPIO_PL061 config GPIO_PL061
bool "PrimeCell PL061 GPIO support" tristate "PrimeCell PL061 GPIO support"
depends on ARM_AMBA depends on ARM_AMBA
select IRQ_DOMAIN select IRQ_DOMAIN
select GPIOLIB_IRQCHIP select GPIOLIB_IRQCHIP

Просмотреть файл

@ -16,6 +16,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/irqchip/chained_irq.h> #include <linux/irqchip/chained_irq.h>
#include <linux/module.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/gpio/driver.h> #include <linux/gpio/driver.h>
#include <linux/device.h> #include <linux/device.h>
@ -408,6 +409,7 @@ static const struct amba_id pl061_ids[] = {
}, },
{ 0, 0 }, { 0, 0 },
}; };
MODULE_DEVICE_TABLE(amba, pl061_ids);
static struct amba_driver pl061_gpio_driver = { static struct amba_driver pl061_gpio_driver = {
.drv = { .drv = {
@ -419,9 +421,6 @@ static struct amba_driver pl061_gpio_driver = {
.id_table = pl061_ids, .id_table = pl061_ids,
.probe = pl061_probe, .probe = pl061_probe,
}; };
module_amba_driver(pl061_gpio_driver);
static int __init pl061_gpio_init(void) MODULE_LICENSE("GPL v2");
{
return amba_driver_register(&pl061_gpio_driver);
}
device_initcall(pl061_gpio_init);