Skip to content

Commit 39fcbbc

Browse files
Paul Gortmakerjoergroedel
authored andcommitted
iommu/tegra: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/iommu/Kconfig:config TEGRA_IOMMU_GART drivers/iommu/Kconfig: bool "Tegra GART IOMMU Support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. We explicitly disallow a driver unbind, since that doesn't have a sensible use case anyway, and it allows us to drop the ".remove" code for non-modular drivers. Since module_init was not in use by this code, the init ordering remains unchanged with this commit. We replace module.h with moduleparam.h since the file does actually declare some module_param() and the easiest way to keep back compatibility with existing use cases is to leave it as-is for now. The init function was missing an __init annotation, so it was added. We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Cc: Hiroshi Doyu <hdoyu@nvidia.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Alexandre Courbot <gnurou@gmail.com> Cc: iommu@lists.linux-foundation.org Cc: linux-tegra@vger.kernel.org Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent f295cf2 commit 39fcbbc

File tree

1 file changed

+7
-30
lines changed

1 file changed

+7
-30
lines changed

drivers/iommu/tegra-gart.c

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*
44
* Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved.
55
*
6+
* Author: Hiroshi DOYU <hdoyu@nvidia.com>
7+
*
68
* This program is free software; you can redistribute it and/or modify it
79
* under the terms and conditions of the GNU General Public License,
810
* version 2, as published by the Free Software Foundation.
@@ -19,7 +21,8 @@
1921

2022
#define pr_fmt(fmt) "%s(): " fmt, __func__
2123

22-
#include <linux/module.h>
24+
#include <linux/init.h>
25+
#include <linux/moduleparam.h>
2326
#include <linux/platform_device.h>
2427
#include <linux/spinlock.h>
2528
#include <linux/slab.h>
@@ -478,20 +481,6 @@ static int tegra_gart_probe(struct platform_device *pdev)
478481
return 0;
479482
}
480483

481-
static int tegra_gart_remove(struct platform_device *pdev)
482-
{
483-
struct gart_device *gart = platform_get_drvdata(pdev);
484-
485-
iommu_device_unregister(&gart->iommu);
486-
iommu_device_sysfs_remove(&gart->iommu);
487-
488-
writel(0, gart->regs + GART_CONFIG);
489-
if (gart->savedata)
490-
vfree(gart->savedata);
491-
gart_handle = NULL;
492-
return 0;
493-
}
494-
495484
static const struct dev_pm_ops tegra_gart_pm_ops = {
496485
.suspend = tegra_gart_suspend,
497486
.resume = tegra_gart_resume,
@@ -501,34 +490,22 @@ static const struct of_device_id tegra_gart_of_match[] = {
501490
{ .compatible = "nvidia,tegra20-gart", },
502491
{ },
503492
};
504-
MODULE_DEVICE_TABLE(of, tegra_gart_of_match);
505493

506494
static struct platform_driver tegra_gart_driver = {
507495
.probe = tegra_gart_probe,
508-
.remove = tegra_gart_remove,
509496
.driver = {
510497
.name = "tegra-gart",
511498
.pm = &tegra_gart_pm_ops,
512499
.of_match_table = tegra_gart_of_match,
500+
.suppress_bind_attrs = true,
513501
},
514502
};
515503

516-
static int tegra_gart_init(void)
504+
static int __init tegra_gart_init(void)
517505
{
518506
return platform_driver_register(&tegra_gart_driver);
519507
}
520-
521-
static void __exit tegra_gart_exit(void)
522-
{
523-
platform_driver_unregister(&tegra_gart_driver);
524-
}
525-
526508
subsys_initcall(tegra_gart_init);
527-
module_exit(tegra_gart_exit);
528-
module_param(gart_debug, bool, 0644);
529509

510+
module_param(gart_debug, bool, 0644);
530511
MODULE_PARM_DESC(gart_debug, "Enable GART debugging");
531-
MODULE_DESCRIPTION("IOMMU API for GART in Tegra20");
532-
MODULE_AUTHOR("Hiroshi DOYU <hdoyu@nvidia.com>");
533-
MODULE_ALIAS("platform:tegra-gart");
534-
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)