From patchwork Mon May 24 07:06:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 12276557 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 47FA6C04FF3 for ; Mon, 24 May 2021 16:23:14 +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 11F74613BF for ; Mon, 24 May 2021 16:23:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11F74613BF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PbGH4X/bBUfZyfsnzzpOvQDU+cLdrIYodo9QN4wabJM=; b=cnFdQVRUTrZErA VN/Enl1DT1auJDslnckk/1VYAELPOz6RzGH0KVrMZPAbSh2DPubYjTgM0J+8/6EK/OROvaeaC6fyu 51vNNJEhVZPY37k9Vl1Vzo79sgmJT0G+82ToHm3xQntqEuzPSxOvAkmT1BuUTF4JLQ0gVNOo9eZY5 UIsCdSXe6Pzqi7iP4CpeLmr/IthxMbgSrB3CxxsksWSOoj+3laU3d/8P0zdUz6PqU3f5lKTe/CoM1 DJx1P/cBKDfemXm0iByTbEHPYIxBRkJOjC6ThP7mMnyim953HvgyO7CwJzE07Rpuo32+8VwuqS2LK OCveV85fIES2sCiIh2AQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llDI5-0014Ci-Dt; Mon, 24 May 2021 16:18:53 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ll4bc-000jK2-6c for linux-arm-kernel@lists.infradead.org; Mon, 24 May 2021 07:02:30 +0000 Received: from dggems704-chm.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FpSjd6cXZzQrVf; Mon, 24 May 2021 14:58:45 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggems704-chm.china.huawei.com (10.3.19.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 15:02:21 +0800 Received: from huawei.com (10.175.103.91) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 15:02:20 +0800 From: Yang Yingliang To: , , CC: Subject: [PATCH -next 1/2] ARM: imx: add missing iounmap() in imx_mmdc_remove() Date: Mon, 24 May 2021 15:06:59 +0800 Message-ID: <20210524070700.3032039-2-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210524070700.3032039-1-yangyingliang@huawei.com> References: <20210524070700.3032039-1-yangyingliang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210524_000228_435679_9EA38A48 X-CRM114-Status: GOOD ( 10.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org mmdc_base need be unmapped in imx_mmdc_remove(). Fixes: e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- arch/arm/mach-imx/mmdc.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index 0dfd0ae7a63d..c313eb1f614c 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -77,6 +77,8 @@ static const struct of_device_id imx_mmdc_dt_ids[] = { { /* sentinel */ } }; +static void __iomem *mmdc_base; + #ifdef CONFIG_PERF_EVENTS static enum cpuhp_state cpuhp_mmdc_state; @@ -456,16 +458,6 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc, return mmdc_num; } -static int imx_mmdc_remove(struct platform_device *pdev) -{ - struct mmdc_pmu *pmu_mmdc = platform_get_drvdata(pdev); - - cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node); - perf_pmu_unregister(&pmu_mmdc->pmu); - kfree(pmu_mmdc); - return 0; -} - static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_base) { struct mmdc_pmu *pmu_mmdc; @@ -528,14 +520,26 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b } #else -#define imx_mmdc_remove NULL #define imx_mmdc_perf_init(pdev, mmdc_base) 0 #endif +static int imx_mmdc_remove(struct platform_device *pdev) +{ +#ifdef CONFIG_PERF_EVENTS + struct mmdc_pmu *pmu_mmdc = platform_get_drvdata(pdev); + + cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node); + perf_pmu_unregister(&pmu_mmdc->pmu); + kfree(pmu_mmdc); +#endif + iounmap(mmdc_base); + return 0; +} + static int imx_mmdc_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - void __iomem *mmdc_base, *reg; + void *reg; struct clk *mmdc_ipg_clk; u32 val; int err;