Skip to content

Commit 6e8fa74

Browse files
willdeaconjoergroedel
authored andcommitted
Revert "iommu/arm-smmu: Make arm-smmu-v3 explicitly non-modular"
This reverts commit c07b642. Let's get the SMMUv3 driver building as a module, which means putting back some dead code that we used to carry. Signed-off-by: Will Deacon <will@kernel.org> Tested-by: John Garry <john.garry@huawei.com> # smmu v3 Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 4312cf7 commit 6e8fa74

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

drivers/iommu/arm-smmu-v3.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
#include <linux/io-pgtable.h>
2222
#include <linux/iommu.h>
2323
#include <linux/iopoll.h>
24-
#include <linux/init.h>
25-
#include <linux/moduleparam.h>
24+
#include <linux/module.h>
2625
#include <linux/msi.h>
2726
#include <linux/of.h>
2827
#include <linux/of_address.h>
@@ -384,10 +383,6 @@
384383
#define MSI_IOVA_BASE 0x8000000
385384
#define MSI_IOVA_LENGTH 0x100000
386385

387-
/*
388-
* not really modular, but the easiest way to keep compat with existing
389-
* bootargs behaviour is to continue using module_param_named here.
390-
*/
391386
static bool disable_bypass = 1;
392387
module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO);
393388
MODULE_PARM_DESC(disable_bypass,
@@ -3683,25 +3678,37 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
36833678
return 0;
36843679
}
36853680

3686-
static void arm_smmu_device_shutdown(struct platform_device *pdev)
3681+
static int arm_smmu_device_remove(struct platform_device *pdev)
36873682
{
36883683
struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
36893684

36903685
arm_smmu_device_disable(smmu);
3686+
3687+
return 0;
3688+
}
3689+
3690+
static void arm_smmu_device_shutdown(struct platform_device *pdev)
3691+
{
3692+
arm_smmu_device_remove(pdev);
36913693
}
36923694

36933695
static const struct of_device_id arm_smmu_of_match[] = {
36943696
{ .compatible = "arm,smmu-v3", },
36953697
{ },
36963698
};
3699+
MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
36973700

36983701
static struct platform_driver arm_smmu_driver = {
36993702
.driver = {
37003703
.name = "arm-smmu-v3",
37013704
.of_match_table = of_match_ptr(arm_smmu_of_match),
3702-
.suppress_bind_attrs = true,
37033705
},
37043706
.probe = arm_smmu_device_probe,
3707+
.remove = arm_smmu_device_remove,
37053708
.shutdown = arm_smmu_device_shutdown,
37063709
};
3707-
builtin_platform_driver(arm_smmu_driver);
3710+
module_platform_driver(arm_smmu_driver);
3711+
3712+
MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
3713+
MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
3714+
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)