mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
memory: tegra20-emc: Make driver modular
Add modularization support to the Tegra20 EMC driver, which now can be compiled as a loadable kernel module. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20201104164923.21238-34-digetx@gmail.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
This commit is contained in:
committed by
Krzysztof Kozlowski
parent
06f079816d
commit
0260979b01
@@ -9,7 +9,7 @@ config TEGRA_MC
|
|||||||
NVIDIA Tegra SoCs.
|
NVIDIA Tegra SoCs.
|
||||||
|
|
||||||
config TEGRA20_EMC
|
config TEGRA20_EMC
|
||||||
bool "NVIDIA Tegra20 External Memory Controller driver"
|
tristate "NVIDIA Tegra20 External Memory Controller driver"
|
||||||
default y
|
default y
|
||||||
depends on ARCH_TEGRA_2x_SOC
|
depends on ARCH_TEGRA_2x_SOC
|
||||||
help
|
help
|
||||||
|
@@ -721,6 +721,13 @@ static int tegra_emc_probe(struct platform_device *pdev)
|
|||||||
platform_set_drvdata(pdev, emc);
|
platform_set_drvdata(pdev, emc);
|
||||||
tegra_emc_debugfs_init(emc);
|
tegra_emc_debugfs_init(emc);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Don't allow the kernel module to be unloaded. Unloading adds some
|
||||||
|
* extra complexity which doesn't really worth the effort in a case of
|
||||||
|
* this driver.
|
||||||
|
*/
|
||||||
|
try_module_get(THIS_MODULE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
unset_cb:
|
unset_cb:
|
||||||
@@ -733,6 +740,7 @@ static const struct of_device_id tegra_emc_of_match[] = {
|
|||||||
{ .compatible = "nvidia,tegra20-emc", },
|
{ .compatible = "nvidia,tegra20-emc", },
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
|
MODULE_DEVICE_TABLE(of, tegra_emc_of_match);
|
||||||
|
|
||||||
static struct platform_driver tegra_emc_driver = {
|
static struct platform_driver tegra_emc_driver = {
|
||||||
.probe = tegra_emc_probe,
|
.probe = tegra_emc_probe,
|
||||||
@@ -742,9 +750,8 @@ static struct platform_driver tegra_emc_driver = {
|
|||||||
.suppress_bind_attrs = true,
|
.suppress_bind_attrs = true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
module_platform_driver(tegra_emc_driver);
|
||||||
|
|
||||||
static int __init tegra_emc_init(void)
|
MODULE_AUTHOR("Dmitry Osipenko <digetx@gmail.com>");
|
||||||
{
|
MODULE_DESCRIPTION("NVIDIA Tegra20 EMC driver");
|
||||||
return platform_driver_register(&tegra_emc_driver);
|
MODULE_LICENSE("GPL v2");
|
||||||
}
|
|
||||||
subsys_initcall(tegra_emc_init);
|
|
||||||
|
Reference in New Issue
Block a user