From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Linus Walleij <linus.walleij@linaro.org>
Cc: linux-tegra@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v1 3/3] gpio: tegra: Support building driver as a loadable module
Date: Fri, 22 Jan 2021 21:55:43 +0300 [thread overview]
Message-ID: <20210122185543.16554-4-digetx@gmail.com> (raw)
In-Reply-To: <20210122185543.16554-1-digetx@gmail.com>
Support building driver as a loadable kernel module. This allows to
reduce size of a kernel zImage, which is important for some devices
since size of kernel partition may be limited and since some bootloader
variants have known problems in regards to the initrd placement if kernel
image is too big.
$ lsmod
Module Size Used by
gpio_tegra 16384 27
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
drivers/gpio/Kconfig | 2 +-
drivers/gpio/gpio-tegra.c | 15 +++++++++------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 1b0acca28c59..c3ce43cc4c31 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -594,7 +594,7 @@ config GPIO_TB10X
select OF_GPIO
config GPIO_TEGRA
- bool "NVIDIA Tegra GPIO support"
+ tristate "NVIDIA Tegra GPIO support"
default ARCH_TEGRA
depends on ARCH_TEGRA || COMPILE_TEST
depends on OF_GPIO
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 1efd6fb642c7..0be24248280a 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -798,6 +798,7 @@ static const struct of_device_id tegra_gpio_of_match[] = {
{ .compatible = "nvidia,tegra20-gpio", .data = &tegra20_gpio_config },
{ },
};
+MODULE_DEVICE_TABLE(of, tegra_gpio_of_match);
static struct platform_driver tegra_gpio_driver = {
.driver = {
@@ -807,9 +808,11 @@ static struct platform_driver tegra_gpio_driver = {
},
.probe = tegra_gpio_probe,
};
-
-static int __init tegra_gpio_init(void)
-{
- return platform_driver_register(&tegra_gpio_driver);
-}
-subsys_initcall(tegra_gpio_init);
+module_platform_driver(tegra_gpio_driver);
+
+MODULE_DESCRIPTION("NVIDIA Tegra GPIO controller driver");
+MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
+MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>");
+MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
+MODULE_AUTHOR("Erik Gilling <konkers@google.com>");
+MODULE_LICENSE("GPL v2");
--
2.29.2
next prev parent reply other threads:[~2021-01-22 19:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-22 18:55 [PATCH v1 0/3] Support building gpio-tegra driver as loadable module Dmitry Osipenko
2021-01-22 18:55 ` [PATCH v1 1/3] gpio: tegra: Use debugfs_create_devm_seqfile() Dmitry Osipenko
2021-01-22 18:55 ` [PATCH v1 2/3] gpio: tegra: Clean up whitespaces in tegra_gpio_driver Dmitry Osipenko
2021-01-22 18:55 ` Dmitry Osipenko [this message]
2021-01-23 22:50 ` [PATCH v1 0/3] Support building gpio-tegra driver as loadable module Linus Walleij
2021-01-23 23:56 ` Dmitry Osipenko
2021-01-24 22:46 ` Linus Walleij
2021-01-25 14:08 ` Dmitry Osipenko
2021-01-27 14:41 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210122185543.16554-4-digetx@gmail.com \
--to=digetx@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=jonathanh@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).