Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: tegra: Support building driver as a loadable module

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>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

authored by

Dmitry Osipenko and committed by
Bartosz Golaszewski
4a6eac2b 66f7aaa4

+9 -6
+1 -1
drivers/gpio/Kconfig
··· 595 595 select OF_GPIO 596 596 597 597 config GPIO_TEGRA 598 - bool "NVIDIA Tegra GPIO support" 598 + tristate "NVIDIA Tegra GPIO support" 599 599 default ARCH_TEGRA 600 600 depends on ARCH_TEGRA || COMPILE_TEST 601 601 depends on OF_GPIO
+8 -5
drivers/gpio/gpio-tegra.c
··· 802 802 { .compatible = "nvidia,tegra20-gpio", .data = &tegra20_gpio_config }, 803 803 { }, 804 804 }; 805 + MODULE_DEVICE_TABLE(of, tegra_gpio_of_match); 805 806 806 807 static struct platform_driver tegra_gpio_driver = { 807 808 .driver = { ··· 812 811 }, 813 812 .probe = tegra_gpio_probe, 814 813 }; 814 + module_platform_driver(tegra_gpio_driver); 815 815 816 - static int __init tegra_gpio_init(void) 817 - { 818 - return platform_driver_register(&tegra_gpio_driver); 819 - } 820 - subsys_initcall(tegra_gpio_init); 816 + MODULE_DESCRIPTION("NVIDIA Tegra GPIO controller driver"); 817 + MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); 818 + MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>"); 819 + MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>"); 820 + MODULE_AUTHOR("Erik Gilling <konkers@google.com>"); 821 + MODULE_LICENSE("GPL v2");