From patchwork Thu Oct 27 10:11:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 11716 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp142067wru; Thu, 27 Oct 2022 03:12:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6sJEbImVsVWLNmTeeZZsfyv1I8UMAkZO0ia7PAm6mhqofM0TQIjcGuTDcPBgwkHNlWmGDM X-Received: by 2002:a05:6402:51ca:b0:462:273b:6ad6 with SMTP id r10-20020a05640251ca00b00462273b6ad6mr11357140edd.119.1666865520915; Thu, 27 Oct 2022 03:12:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666865520; cv=pass; d=google.com; s=arc-20160816; b=VXV6rf11epCDDJFLs56/o/DpViLUcvqcmQxtUlM27tSmZwbnVB5Ib2Ck4ffBQnDfNt nBWeJZC8vrNR0RgNHdl2Ctj7cpqwKMuEz/rzjRHGHfHObjjgI8Y9wHGfHytizjlICfst TF+2ufDsUWHnvC7GlbRLm3jDlSI/6XbXXpb+njeWQuwttFvnMAKn1nGt4BP2O3I+ZJcN PHsRIkWyWsZCEiDU/VDMgRJEH9Avy/3JcIpkTUbXHIhh36ALO3j97N85AbUdj1qXTz56 Y/elHVy+Wg4UlZ7wfGITRJYYmdn3jekMLX1E6MIylBR5WZX0rZhaQTnhBv/pNkYaxsAy nc2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dCK4+CAft4YD+4vtWrpNNJ50gAt2GZlH8Q7y4AflR0s=; b=fGaeWqmrTLrqisYnOFycsZYcxN536vK4xkhGPT+hjFxkLLBIs3+doCpocArCo/dBb4 dcW+8n5Cau6h0iB9iT6IAwBuRq9yE1PZGHkP6uWp/pS4kdYLf23vEdwj11DKZ4Eai300 b6GL/56SJVYL+HE9J34t1RRkmbbL9T1ktAW8YJQKZypWnNKVvTzZ/RmfEOEmNFhEm6d6 2E0r7TT2wUr394qRLAVGq7XuUEhm9cOU3tjMLrrjpvVu3P1GA5c7DFPkHC3lXP1SUJLj 8n4Y/hM9yBAUUFpIss3zBaHFjmqiTRyjM3+9yCPUMN74LmuDYw1Nyw1sdsiPgT7uh4Yk fjqg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=kvrcC+yV; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a170906794900b0079b8cce1170si1051769ejo.950.2022.10.27.03.11.32; Thu, 27 Oct 2022 03:12:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=kvrcC+yV; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235166AbiJ0KKu (ORCPT + 99 others); Thu, 27 Oct 2022 06:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235147AbiJ0KKn (ORCPT ); Thu, 27 Oct 2022 06:10:43 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2045.outbound.protection.outlook.com [40.107.105.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DD6B4B9B2; Thu, 27 Oct 2022 03:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QZwfQAH7FIF+7lgZQqjsAr66TKZFdgCi3Xb0Wg9vT81c+WqHROThE3XznYfVI6keh/5wB+psO/L97s5+ykYLk09k7OXXTEVPmUVHpffWnkaLddLhXbStHvKkMTbYOhqI85jS68NCo83dXNegoA7p5bK5iOkQ7Vkr+cvbBe/FMgLDkfY25yM9ZMVMMnTA0u7KC5OSKtj3goBDClN2VWdd54nixDbpPVpy4goZBwkpnh9zGr6VypJTpkny4Uj7fDAeyoMSXJsEDU4nyoGkb8c98pT+xNSJ1lb9q9Iq6iHZMXxmobrODWfAmgYUnV8oATzrOhNal1KB1Jjew75qUmVAzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dCK4+CAft4YD+4vtWrpNNJ50gAt2GZlH8Q7y4AflR0s=; b=ezOil3aGbxmGh7DFwnDEV4W2PeB5LWoSAyk78BS9paZZLUOZ/6rX8mJcmosxOsqd1anJyHhyz3Wo77aZoECff6jxjRtfXr8rne58F0wem2Wi8S8f/qLcAAq4bXDXSllPWEv0nq0Ke2pqQLAroE/q1NkhY1AXtxa6K8aV4uIxyrZ1PHFXEKvr53hMySU1aMNRxsP+bGWauhzgGUeAljQL16FysQvAzlhtoCCcfOqNo1QhUbc4KyCTSejT8MMHBOfLHzb0J+XxDjsO8ahibxtNFUNpXUCSix3ZuKkcTUyblC0xshzT816vz7wbmDyY9EoUI1thWljoCJqyFB2jl3WPDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dCK4+CAft4YD+4vtWrpNNJ50gAt2GZlH8Q7y4AflR0s=; b=kvrcC+yVayN2pWRpgzT4ywpDVkCn7yWR5PwvOvqbxjRFAFWhh0oovGvj8Nrva1NaygnhmBbH89GYpnODvvy79rq78VLtgJzf5poStFI0AFeqxnPIvrR1jZRlPsqFkXaBea+OjSo6SVaq9aFIc3WHZCuaK1w2CLOpuVv/TfSn7T8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by AM7PR04MB6871.eurprd04.prod.outlook.com (2603:10a6:20b:109::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Thu, 27 Oct 2022 10:10:38 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::1587:379:da06:2f18]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::1587:379:da06:2f18%5]) with mapi id 15.20.5746.028; Thu, 27 Oct 2022 10:10:38 +0000 From: "Peng Fan (OSS)" To: abelvesa@kernel.org, abel.vesa@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: linux-imx@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Peng Fan , Dan Carpenter Subject: [PATCH 1/6] clk: imx93: unmap anatop base in error handling path Date: Thu, 27 Oct 2022 18:11:54 +0800 Message-Id: <20221027101159.942843-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221027101159.942843-1-peng.fan@oss.nxp.com> References: <20221027101159.942843-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI1PR02CA0031.apcprd02.prod.outlook.com (2603:1096:4:1f6::11) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|AM7PR04MB6871:EE_ X-MS-Office365-Filtering-Correlation-Id: 58e0ce20-6616-4c79-cde2-08dab8037ea6 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NoFaazaFWN9AXmuwt/wSVN4lFlGkuFwF5iIk1BLgr67LrjeNHh6Qbjq4nhX3dsl0wHeJQQUuaLVhzawyzgeUlSd7q1vgVkbVXWDkiz2H4yFNyayJtzEoBBwxjTSY41Kedp+6GHeN2lID1sSuBnVJnbGOoi3U5QRjzmTPNI/pDkvbVnH/qKB3fz/hAnvrYPzKfdNvj/UkIK9GN1W3hm3+dlYL0UslavFWJZzBwR75laiDkAd8AV4i46/DSZktO+bntD8cBYc48K8OYBFnmn9z7XTBaujU7Ojmbz+sICvTUTrpbFxOHUcUr3ilB/8TWZWjdK2N/SuWYDU2nBs+CrUpMBAIX71K9clfFf2SbEMh7Jy/SkzyDSVBqrPCyUAvXxqW2BIy7ELRQ9Cdp2LKyEfKFj1llr4BiS99HdgN/FOekwfasRY2BdD+sLrfH/WRQi2NShZC+2k+7eHYn28N5VaBotwt66OY8KlSdFx42XAYOF19Gu3/7lZiQ6dH+2+mJrXQ6yN00WAQ18FSLBB5TkE26/ZFmNBHZOu4WpHaAlhMXp9YM61uRdSzNZJ5wXm5+OEHaqU6DsvVbfT7RxJWJYCbKsU6Ju0sIqq65vjWnn5J1qnYln6sWJt7dWrrq1a1c3tuUEtNwCD5GY4JYrKsfNRsKvj9CDevPQELdFuAhmpxoEkV/lHpOAkRZnEZ66Yn7aFwl9KGji8Bjuzio6/ZVIH2zzllrcLvI406SzbjtGEpxLJs4gX9y6x8vU7ETepAb5CRdfH5hCL15Te7UTrZzflldzqnMieoyUng1Vn7rDkkxAE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(396003)(39860400002)(346002)(376002)(136003)(451199015)(316002)(54906003)(83380400001)(38350700002)(8936002)(41300700001)(921005)(7416002)(86362001)(5660300002)(2906002)(4326008)(8676002)(66476007)(66556008)(66946007)(38100700002)(6506007)(6486002)(52116002)(478600001)(6666004)(186003)(1076003)(2616005)(6512007)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oS4KTllouKrZ+8HmZoFP4FM00IHOhb4QA2+SyZoeJ1fWf0BOh7WosQvtRPi1jjJW7pbeuvEVuXq+t9kbeKCAV3uoUs4oL9qnrl5qPajcreQlTAompd2yS3O/MdF8YU8yCIkmIGtGkdIW3pczprZUwMQgaqmV9GQPR/DQnE6SJ69iE+FDOfV7zggcwCtUTv71FBAbCLVDzJy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6WLxx9hYg9Yn5H8rDtKgQ+T5/PGUmE8pEc4Wb48Dba3ZjdIfYc2LEmsAtWqeY8JTdPrZLweqBuYJiSFoCQFIlJUCFy+sjuOAERYDVlxifSp+uT4FNoSB1/vGVgWYSsXW6W0qYqhpk4kKqcqyf9ZU4nqKFOmFRqJFLHuhKB8ExN0AoXXMWy48kHgXUFYeu/MIwhn+LVvQN6CNcVhiFwf+cpJ2foA51HcwOouBfz64mOUnFaNf7SyDl6beiOWYl2wtu5PVFs+GNQ5GWWaOUCKPSsJxPExKQZ58CWuN3IbCWpHhZffZodnqDuyJpmweJlyyh X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58e0ce20-6616-4c79-cde2-08dab8037ea6 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2022 10:10:38.1569 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jy3yKLipYm0hrCWReIzj6qusuU0wyfsioh04eg9WQq8oLFNi9pDK1qgkUPkZG61xiXwwBjNpq2+44bnT4t4qMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6871 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747835180618824484?= X-GMAIL-MSGID: =?utf-8?q?1747835180618824484?= From: Peng Fan The anatop base is not unmapped during error handling path, fix it. Fixes: 24defbe194b6 ("clk: imx: add i.MX93 clk") Reported-by: Dan Carpenter Signed-off-by: Peng Fan --- drivers/clk/imx/clk-imx93.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c index 99cff1fd108b..9ef3fcbdd951 100644 --- a/drivers/clk/imx/clk-imx93.c +++ b/drivers/clk/imx/clk-imx93.c @@ -258,7 +258,7 @@ static int imx93_clocks_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; const struct imx93_clk_root *root; const struct imx93_clk_ccgr *ccgr; - void __iomem *base = NULL; + void __iomem *base, *anatop_base; int i, ret; clk_hw_data = kzalloc(struct_size(clk_hw_data, hws, @@ -285,20 +285,22 @@ static int imx93_clocks_probe(struct platform_device *pdev) "sys_pll_pfd2", 1, 2); np = of_find_compatible_node(NULL, NULL, "fsl,imx93-anatop"); - base = of_iomap(np, 0); + anatop_base = of_iomap(np, 0); of_node_put(np); - if (WARN_ON(!base)) + if (WARN_ON(!anatop_base)) return -ENOMEM; - clks[IMX93_CLK_AUDIO_PLL] = imx_clk_fracn_gppll("audio_pll", "osc_24m", base + 0x1200, + clks[IMX93_CLK_AUDIO_PLL] = imx_clk_fracn_gppll("audio_pll", "osc_24m", anatop_base + 0x1200, &imx_fracn_gppll); - clks[IMX93_CLK_VIDEO_PLL] = imx_clk_fracn_gppll("video_pll", "osc_24m", base + 0x1400, + clks[IMX93_CLK_VIDEO_PLL] = imx_clk_fracn_gppll("video_pll", "osc_24m", anatop_base + 0x1400, &imx_fracn_gppll); np = dev->of_node; base = devm_platform_ioremap_resource(pdev, 0); - if (WARN_ON(IS_ERR(base))) + if (WARN_ON(IS_ERR(base))) { + iounmap(anatop_base); return PTR_ERR(base); + } for (i = 0; i < ARRAY_SIZE(root_array); i++) { root = &root_array[i]; @@ -327,6 +329,7 @@ static int imx93_clocks_probe(struct platform_device *pdev) unregister_hws: imx_unregister_hw_clocks(clks, IMX93_CLK_END); + iounmap(anatop_base); return ret; }