diff mbox

[v3,01/12] iommu/rockchip: Prohibiat unbind and remove

Message ID 20180117152542.26429-2-jeffy.chen@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeffy Chen Jan. 17, 2018, 3:25 p.m. UTC
Removal the IOMMUs cannot be done reliably.

This is similar to exynos iommu driver.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v3:
Also remove remove() and module_exit() as Tomasz suggested.

Changes in v2: None

 drivers/iommu/rockchip-iommu.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

Comments

Tomasz Figa Jan. 18, 2018, 4:17 a.m. UTC | #1
On Thu, Jan 18, 2018 at 12:25 AM, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
> Removal the IOMMUs cannot be done reliably.

nit: Perhaps "Removal of IOMMUs"?

>
> This is similar to exynos iommu driver.
>
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---
>
> Changes in v3:
> Also remove remove() and module_exit() as Tomasz suggested.
>
> Changes in v2: None
>
>  drivers/iommu/rockchip-iommu.c | 21 +--------------------
>  1 file changed, 1 insertion(+), 20 deletions(-)

nit: Typo in subject: s/Prohibiat/Prohibit/

Otherwise,

Reviewed-by: Tomasz Figa <tfiga@chromium.org>

Best regards,
Tomasz
Jeffy Chen Jan. 18, 2018, 8:28 a.m. UTC | #2
Hi Tomasz,

Thanks for your reply.

and just found i forgot to add iommu clocks for other rockchip 
platforms(rk3399 already has that)...will also do that in the next version.

On 01/18/2018 12:17 PM, Tomasz Figa wrote:
> On Thu, Jan 18, 2018 at 12:25 AM, Jeffy Chen <jeffy.chen@rock-chips.com> wrote:
>> Removal the IOMMUs cannot be done reliably.
>
> nit: Perhaps "Removal of IOMMUs"?
>
ok
>>
>> This is similar to exynos iommu driver.
>>
>> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
>> ---
>>
>> Changes in v3:
>> Also remove remove() and module_exit() as Tomasz suggested.
>>
>> Changes in v2: None
>>
>>   drivers/iommu/rockchip-iommu.c | 21 +--------------------
>>   1 file changed, 1 insertion(+), 20 deletions(-)
>
> nit: Typo in subject: s/Prohibiat/Prohibit/
>
ok, will do that.
> Otherwise,
>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
>
> Best regards,
> Tomasz
>
>
>
diff mbox

Patch

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 9d991c2d8767..16cd8780c289 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -1197,18 +1197,6 @@  static int rk_iommu_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int rk_iommu_remove(struct platform_device *pdev)
-{
-	struct rk_iommu *iommu = platform_get_drvdata(pdev);
-
-	if (iommu) {
-		iommu_device_sysfs_remove(&iommu->iommu);
-		iommu_device_unregister(&iommu->iommu);
-	}
-
-	return 0;
-}
-
 static const struct of_device_id rk_iommu_dt_ids[] = {
 	{ .compatible = "rockchip,iommu" },
 	{ /* sentinel */ }
@@ -1217,10 +1205,10 @@  MODULE_DEVICE_TABLE(of, rk_iommu_dt_ids);
 
 static struct platform_driver rk_iommu_driver = {
 	.probe = rk_iommu_probe,
-	.remove = rk_iommu_remove,
 	.driver = {
 		   .name = "rk_iommu",
 		   .of_match_table = rk_iommu_dt_ids,
+		   .suppress_bind_attrs = true,
 	},
 };
 
@@ -1248,14 +1236,7 @@  static int __init rk_iommu_init(void)
 		platform_driver_unregister(&rk_iommu_domain_driver);
 	return ret;
 }
-static void __exit rk_iommu_exit(void)
-{
-	platform_driver_unregister(&rk_iommu_driver);
-	platform_driver_unregister(&rk_iommu_domain_driver);
-}
-
 subsys_initcall(rk_iommu_init);
-module_exit(rk_iommu_exit);
 
 MODULE_DESCRIPTION("IOMMU API for Rockchip");
 MODULE_AUTHOR("Simon Xue <xxm@rock-chips.com> and Daniel Kurtz <djkurtz@chromium.org>");