diff options
author | Rob Herring <robh@kernel.org> | 2020-04-09 03:41:10 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2020-04-14 16:23:46 +0200 |
commit | 616844408de7f21546c3c2a71ea7f8d364f45e0d (patch) | |
tree | 8fa261e10cc99b1337e2a3319c7feb3025113c4d /drivers/gpio/gpio-pl061.c | |
parent | gpio: Extend TODO to cover code duplication avoidance (diff) | |
download | linux-616844408de7f21546c3c2a71ea7f8d364f45e0d.tar.xz linux-616844408de7f21546c3c2a71ea7f8d364f45e0d.zip |
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>
Diffstat (limited to 'drivers/gpio/gpio-pl061.c')
-rw-r--r-- | drivers/gpio/gpio-pl061.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index e241fb884c12..f1b53dd1df1a 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> @@ -408,6 +409,7 @@ static const struct amba_id pl061_ids[] = { }, { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, pl061_ids); static struct amba_driver pl061_gpio_driver = { .drv = { @@ -419,9 +421,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"); |