Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11556141imu; Tue, 1 Jan 2019 01:50:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN5//W+CAgj0e6dP5FhC9O/qk+HKdD/qmKoW8y4z6sQei0DX9JmDBDRwExRMEDQzoq4hLrY9 X-Received: by 2002:a62:55c4:: with SMTP id j187mr40620258pfb.129.1546336221195; Tue, 01 Jan 2019 01:50:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546336221; cv=none; d=google.com; s=arc-20160816; b=QgqwaiP4H/s4ZeUTse/qmjrThohEwYCt6i7XcoSWQXQAFo35Xos5aL+AsmH0z65MRh ApBIRKDfcO509j9TGxGT7N/NquVgxkdHkCuO22Zycctpw/UZR+frclEFLWhvlOPU5LIG g4mOuh2f0X3FC3jZU1u1/6SamfxXzOGYn+XoMWur6Irp58o/a8r8LVb2UBmE6Shffw6u 5hL5xJDZcely5NteNJFPHsdIPkkiFeTtUByVfwoFpAD3+wcvVJvSig6nthctNMtla8IX 7F6cA3REFg18um3FZkuxYkrwywGs0I2MiEPWAtGdGkxDERFgVox1U4dk+FHsret4TKzP IYMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=a/PQG/NJp4jmgs0jRPqPDGCPJbG5oUVwNCombYZKdIQ=; b=MJ7rm1dy3BeN5JdBYYyYHFBlZgFUaQGDsvE87cA5B5uyxgGwlVcORixC+Z6muaN+79 k3Bq0BW262//L12oI5k31dMcaq5XW/BAIpi25h7AiY9OThCGFgCbQ2ZrLK/EHDn+/6hf hwfacK/sMfSNzfhp1ExLvlrO6p4pFYc17iewgT/s8zsv8m8trjS/hD/gWaV783QsrG43 tgOfo0/HZXbg5sVJIu0WvExnMYVc3eMD2MjBV9ccdsl99l8DLT0unCWlM2x4Chlm6EYQ +0eNyKfg3e548chGPos+AIUarnvzRXuMfgGMjI/QEjaAyA2D5ynMkzrqnDVoKum2z5Gw WLGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si44436208plt.181.2019.01.01.01.50.05; Tue, 01 Jan 2019 01:50:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728563AbfAAExL (ORCPT + 99 others); Mon, 31 Dec 2018 23:53:11 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:31113 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727370AbfAAExK (ORCPT ); Mon, 31 Dec 2018 23:53:10 -0500 X-UUID: 80db2e4edc424da3be63f1615359206f-20190101 X-UUID: 80db2e4edc424da3be63f1615359206f-20190101 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 232489272; Tue, 01 Jan 2019 12:53:05 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 1 Jan 2019 12:53:03 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 1 Jan 2019 12:53:02 +0800 From: Yong Wu To: Joerg Roedel , Greg Kroah-Hartman , Matthias Brugger , Rob Herring CC: Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , , , Nicolas Boichat Subject: [PATCH 11/13] iommu/mediatek: Use builtin_platform_driver Date: Tue, 1 Jan 2019 12:51:14 +0800 Message-ID: <1546318276-18993-12-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1546318276-18993-1-git-send-email-yong.wu@mediatek.com> References: <1546318276-18993-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 763C6A7E7CF2199B37B7CB189F52E0010B63FEC48DC0003EBCE5814974BE44872000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MediaTek IOMMU should wait for smi larb which need wait for the power domain(mtk-scpsys.c) and the multimedia ccf who both are module init. Thus, subsys_initcall for MediaTek IOMMU is not helpful. Switch to builtin_platform_driver. Meanwhile, the ".remove" can be removed. Move its content to ".shutdown". Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 23 ++--------------------- drivers/iommu/mtk_iommu_v1.c | 16 ++-------------- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 735ae8d..2798b12 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -690,7 +690,7 @@ static int mtk_iommu_probe(struct platform_device *pdev) return component_master_add_with_match(dev, &mtk_iommu_com_ops, match); } -static int mtk_iommu_remove(struct platform_device *pdev) +static void mtk_iommu_shutdown(struct platform_device *pdev) { struct mtk_iommu_data *data = platform_get_drvdata(pdev); @@ -703,12 +703,6 @@ static int mtk_iommu_remove(struct platform_device *pdev) clk_disable_unprepare(data->bclk); devm_free_irq(&pdev->dev, data->irq, data); component_master_del(&pdev->dev, &mtk_iommu_com_ops); - return 0; -} - -static void mtk_iommu_shutdown(struct platform_device *pdev) -{ - mtk_iommu_remove(pdev); } static int __maybe_unused mtk_iommu_suspend(struct device *dev) @@ -791,7 +785,6 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev) static struct platform_driver mtk_iommu_driver = { .probe = mtk_iommu_probe, - .remove = mtk_iommu_remove, .shutdown = mtk_iommu_shutdown, .driver = { .name = "mtk-iommu", @@ -799,16 +792,4 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev) .pm = &mtk_iommu_pm_ops, } }; - -static int __init mtk_iommu_init(void) -{ - int ret; - - ret = platform_driver_register(&mtk_iommu_driver); - if (ret != 0) - pr_err("Failed to register MTK IOMMU driver\n"); - - return ret; -} - -subsys_initcall(mtk_iommu_init) +builtin_platform_driver(mtk_iommu_driver); diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 022bad9..5464918 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -648,7 +648,7 @@ static int mtk_iommu_probe(struct platform_device *pdev) return component_master_add_with_match(dev, &mtk_iommu_com_ops, match); } -static int mtk_iommu_remove(struct platform_device *pdev) +static void mtk_iommu_shutdown(struct platform_device *pdev) { struct mtk_iommu_data *data = platform_get_drvdata(pdev); @@ -661,12 +661,6 @@ static int mtk_iommu_remove(struct platform_device *pdev) clk_disable_unprepare(data->bclk); devm_free_irq(&pdev->dev, data->irq, data); component_master_del(&pdev->dev, &mtk_iommu_com_ops); - return 0; -} - -static void mtk_iommu_shutdown(struct platform_device *pdev) -{ - mtk_iommu_remove(pdev); } static int __maybe_unused mtk_iommu_suspend(struct device *dev) @@ -705,7 +699,6 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev) static struct platform_driver mtk_iommu_driver = { .probe = mtk_iommu_probe, - .remove = mtk_iommu_remove, .shutdown = mtk_iommu_shutdown, .driver = { .name = "mtk-iommu-v1", @@ -713,9 +706,4 @@ static int __maybe_unused mtk_iommu_resume(struct device *dev) .pm = &mtk_iommu_pm_ops, } }; - -static int __init m4u_init(void) -{ - return platform_driver_register(&mtk_iommu_driver); -} -subsys_initcall(m4u_init); +builtin_platform_driver(mtk_iommu_driver); -- 1.9.1