From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40159C282DD for ; Mon, 10 Jun 2019 13:01:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1260320859 for ; Mon, 10 Jun 2019 13:01:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kyK3rAYz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1260320859 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GVRBQtQbq5eM5ZPbHI/3UckjxF3DacNgTwV1B/BSip4=; b=kyK3rAYzpQ4+tC HppjQiLSJ7mnlAfImz9NxW8wvpb/NowqzlvYbKXDCJFgNI5SzUswNxlng2rSv1xZYqH4viNdccLWJ nR4q+fkGKqZVk0Fy70+fnq2DfD4tJcIJY/tG/o2EqbQX0WanvUh0eo6jvgi8JolhdJXRYZKkJh5/F C4VsXijD79zi53Ee2R2kY/hWKtbMxBY4MLuYuHCjw/S9k1Ii+gwTLnGMU4j+HD9zoBwf2G8iSrdqd UJkJ1bI3lE0vcNXGwpOSl7uqDZTuSK3gBBnxdc3V6FIPuQGLw/kKcpLwsvs0QSjthInPMVSN6dCl6 k+XgWIUtCgO3wNgaji5g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haJvS-0000sW-Ri; Mon, 10 Jun 2019 13:01:26 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haJt6-0005Zq-It; Mon, 10 Jun 2019 12:59:03 +0000 X-UUID: 684e02f1eebc458d9367f31a732abcad-20190610 X-UUID: 684e02f1eebc458d9367f31a732abcad-20190610 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 644552433; Mon, 10 Jun 2019 04:57:28 -0800 Received: from MTKMBS01N2.mediatek.inc (172.21.101.79) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Jun 2019 05:57:26 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Jun 2019 20:57:12 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 10 Jun 2019 20:57:11 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Rob Herring Subject: [PATCH v2 10/12] iommu/mediatek: Use builtin_platform_driver Date: Mon, 10 Jun 2019 20:55:11 +0800 Message-ID: <1560171313-28299-11-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1560171313-28299-1-git-send-email-yong.wu@mediatek.com> References: <1560171313-28299-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 0B4467784B60C69D2AAF2FE86A910E03F9188BE23B7075579B2F4AFD6A43305B2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_055900_842209_586D6FFB X-CRM114-Status: GOOD ( 10.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: youlin.pei@mediatek.com, devicetree@vger.kernel.org, Nicolas Boichat , srv_heupstream@mediatek.com, Will Deacon , linux-kernel@vger.kernel.org, Evan Green , Tomasz Figa , iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, yong.wu@mediatek.com, yingjoe.chen@mediatek.com, anan.sun@mediatek.com, Robin Murphy , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 31 +------------------------------ drivers/iommu/mtk_iommu_v1.c | 24 +----------------------- 2 files changed, 2 insertions(+), 53 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 7b70574..8459597 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -712,22 +712,6 @@ 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) -{ - struct mtk_iommu_data *data = platform_get_drvdata(pdev); - - iommu_device_sysfs_remove(&data->iommu); - iommu_device_unregister(&data->iommu); - - if (iommu_present(&platform_bus_type)) - bus_set_iommu(&platform_bus_type, NULL); - - 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 int __maybe_unused mtk_iommu_suspend(struct device *dev) { struct mtk_iommu_data *data = dev_get_drvdata(dev); @@ -808,23 +792,10 @@ 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, .driver = { .name = "mtk-iommu", .of_match_table = of_match_ptr(mtk_iommu_of_ids), .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 845e20b..1c0fb82 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -650,22 +650,6 @@ 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) -{ - struct mtk_iommu_data *data = platform_get_drvdata(pdev); - - iommu_device_sysfs_remove(&data->iommu); - iommu_device_unregister(&data->iommu); - - if (iommu_present(&platform_bus_type)) - bus_set_iommu(&platform_bus_type, NULL); - - 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 int __maybe_unused mtk_iommu_suspend(struct device *dev) { struct mtk_iommu_data *data = dev_get_drvdata(dev); @@ -702,16 +686,10 @@ 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, .driver = { .name = "mtk-iommu-v1", .of_match_table = mtk_iommu_of_ids, .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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel