Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3178538pxj; Mon, 24 May 2021 00:04:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2Yb+ei5c0vLkxnITDU5IihYjQRlOSQILmYMT3rGCx+CtKnFH4gZ1RtvwtZnwvQ314tDAQ X-Received: by 2002:a05:6602:2416:: with SMTP id s22mr13271772ioa.15.1621839889411; Mon, 24 May 2021 00:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621839889; cv=none; d=google.com; s=arc-20160816; b=NiZxwkCw6ed35hmxzQB1YYUf+ulBh12A7zj6zhIkUGJMKk6tlRSTxYjMXzl5ICpHOM sjtb1RN20d2e2xRzyC5RAHhodjCCArZ/ms1Yp2HnLtGruYAA847OOHXdB1XEvTlPcYQ6 wMCUatpv8cUfZyLZn5wyhgT5zZTlxS/XPt+0qrhE9r2EMy4z21e592WYFJgtbR+jL4hW ZJ1Gc7/Q8HR5k+evVenLImj4NZLHOSOPk+0qUvszhdooTgbjY1jjPWIcaxHbeBEQRiJx ROjamrNvZoe/T6Tu8wuSDLP3obu+cz/yFT+b0mS9BQqKfgh5J5HeOwfTvyJtnK3ocVto nBdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=3nYPKm4yNLE94MdSacVG0EoGhttA4PixzFksUaCzhl4=; b=APK8nVLs7am0lBHewO18eQZoelAcu/KcQBzcl0R7zgEsUYW2BzAEwLUfRil9ewV2aF JAUCd4aP2stUVd2lu0JRsdgbTEp9yJOTJ3vFeZPCKw+btArSqi8217cJOEYMSCkC9KuT abxgw/ha3UpsyLCs/yIqAbNadS1oz/W2uqd2F7D/qPFX5mr4itRuV7CZv8IVUYVhPF// //9wzSo6dN5zRJjzUtvyxdXXOAyHLmR7oL1f9zJeVW1ehag/nmSmgyCQj0koclcw2EeB pF5i/aQHqQdfVb+0BinqJWbesTGWRZxDYEsmgh3l5SeideNCg0nAp205MY12JME7BBYp SFzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l21si13887014iol.42.2021.05.24.00.04.36; Mon, 24 May 2021 00:04:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232359AbhEXHDx (ORCPT + 99 others); Mon, 24 May 2021 03:03:53 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3640 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232381AbhEXHDv (ORCPT ); Mon, 24 May 2021 03:03:51 -0400 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; -- 2.25.1