From patchwork Wed Jul 5 08:18:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 13301825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D69DEB64DD for ; Wed, 5 Jul 2023 08:20:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232466AbjGEIUr (ORCPT ); Wed, 5 Jul 2023 04:20:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbjGEIUY (ORCPT ); Wed, 5 Jul 2023 04:20:24 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2072a.outbound.protection.outlook.com [IPv6:2a01:111:f403:704b::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 311791FCF; Wed, 5 Jul 2023 01:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fgicCFOy68Qxtu6a0yCgJXY0+25NmuNnOmbh6o5a4+Eblkwhq1n9STCLhRILQ4jzaI68uUPqMFKIP2DsbPwbIs2g2NHTCCLhp3eHz8MG4cTDpEsE+2rTeoYyiI97jb3b5SjdfLZZF2euOCZydPS0bSwd/svNhl2BuWXQ08X5z4xpb3SUrG7kn22Qg8c7dzkRumSBjN5ILReNhBqK1x9qGE2Z1coSrJaqd5oAc7q0tmU2LATd7mzeIW3q3spTs7tH2lSrBpATWFYHzcIc4EFJspTEJYP1mwT/URmgfmgVh7E1HA5AA3JmShWBXEnsPC0YO+8mDynPXJOH9+m2/zZjpQ== 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=Li11zbLzf1YFMqKUTEIvOK09mYXdHEPAbxQ9C2YqLVs=; b=VnmO0hQiurW3SttdCpFQk1E6XE2Tq0unDH5ZiV0XO3tZ8wU3zg2kzugPzXViYbM3hIyzfSDYxRZsioAwmV8RgKEDInkg2o4TqKDaa5KgkQmsLPQ0tucUp5KW5iGSNt1ZmcD2V8YzoEn7XvUbuV/ANnLSIuqTVxCuyO/Kp6oHdtzlofmeoEN5p1MTb8rK20Zf2P+pbrv4OIO1uNcw3CR2/1qVPv4KPzy79+u9w+v+uRYmufYgb2I18dCa8bTtQKktBH3mr0JMBWHv/c9WKOMzU12/L1RoQ0XesUHWV5+cjvGECTHJpnC0BBL6vNANgz3ABLswpgjOygJqPARPzUYCCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Li11zbLzf1YFMqKUTEIvOK09mYXdHEPAbxQ9C2YqLVs=; b=BcKN6qfOoOhGBPMYeCtaRHZp9UM/RLFcmva0iK0hiIVuCJjniuAe9kNi/trD439yfIb33Bgpa11NwpYlHn8jrJ7g5s95HekK9goHrmSYjq3MxyRwMFgsgUsvkaAa9lvNYebga6OYG+/GxR74h7JG/DosCAavPWNAD+zqY2r1YREk/31UfYeCJE0VdfdUiOdCJVTeMxGxvCXo+NJqhnmb3XlUhaO5nehEjpPZleuMSsdYPimD6fb/q65jPFQma6QdrOBAM4bwMXN3+sNJ8mTo/AStKou6Zo9+Owzomr55e1sdm9mlE2b5KGIMdZvGEorockhPxnDYyHzEQFjl7yDbEQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEZPR06MB5119.apcprd06.prod.outlook.com (2603:1096:101:4e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 08:19:10 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023 08:19:10 +0000 From: Yangtao Li To: Sinan Kaya , Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul Cc: Yangtao Li , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] dmaengine: qcom_hidma: Use devm_platform_get_and_ioremap_resource() Date: Wed, 5 Jul 2023 16:18:53 +0800 Message-Id: <20230705081856.13734-2-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230705081856.13734-1-frank.li@vivo.com> References: <20230705081856.13734-1-frank.li@vivo.com> X-ClientProxiedBy: SG2P153CA0044.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::13) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEZPR06MB5119:EE_ X-MS-Office365-Filtering-Correlation-Id: 92c66c87-f94b-4557-21d2-08db7d30828f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bgrDN9HXVdv+YQxzWlaY81zHMTqYxgE/J3GaPpOJrD9B+Q9HwZxiP/5yZ6N3kqtolJaIdmLF/RS8VrDDGXfgDpyUG8DA2zGM/ZyQgZJ0rDexuSh3Ab6x+GCeIMGPY4PqxknjfGwuv95cN0Gy12GG3z6xrBbGi3aoZoZGCE6VtENSszvXhVnkD8S3n8ThpVOgM7OC335KX5ZECJEUJM8AfNh1B51dj/4SbleqYPuRcXudvgAA+k/t6msn9j7daEcMcAqmvrFyfAqnIEnls9oCnabQREXtPbvkodGNq8vPz2oLlYhk8A+ygHGhnayGtbLcWbFU2hoYUSg1m/FXnPObmm30Vyjb5azNR9xbFsO/bWTEaQ2R3B/RmLM4Pq3F/J549280uMgBhsBa0iavqt3GmxI+FMd/UhqXpzp+sojv26aIda0tw/lxjUHFkI/Akky4Gj+ZeqYxuDKKcCdODyQi4wNk370gCXjP4ESAEwAolaABqY05WYSWHyAO9HG4aCdj8l8ducKvQ2mVa4hbhJHAaNjHZ6s4Ha6V8MGNfSogIxcF3WAXfaedKP9uRs+dlpHD/8b0kwvbrdcg1NP3/r45niiqcdHLtJwZNgVkqyBTEv9jTrpJON0gbe42/7jTqZv+ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(396003)(366004)(376002)(39860400002)(451199021)(316002)(2616005)(4326008)(66556008)(66946007)(83380400001)(8936002)(86362001)(52116002)(1076003)(2906002)(66476007)(5660300002)(8676002)(41300700001)(36756003)(6486002)(6512007)(186003)(6506007)(478600001)(26005)(6666004)(110136005)(38350700002)(38100700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Iyvc3QKZQH8DZ7YeI6Yj31OtpWHjLDACAtxOn9tSwfo5k0hFDbL3kMW5kgAev44mVlK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FksNWbnU1FMJSFfEHGQILAFagsrlWbfz7IYMGi1d16GlK2cSyOo6dIsR3pfa7abuNrXnvZWtZMMOrQK5wyQ2HbPBjqFkq47Yh+bD5WhnKNDt5D+eBGk1J7LN4b85C6ggteshG0t29Mg2uHD6467Z/WY73YAUtlBitVE+wquuN9O6IJWG8NgHMY0mIZWgP9XcfNvNMrQbz3aLlH43giUUBRBX5fi9X1B+8bBh2zIbWS4AO1lRnrBLsXqh/NZG0XG/PgjbuV/sMhehvAtp9AXKYthHO2eSLUSLwTbbFQ1Kyb58h3ia1vxvfSKTIQ0YcK5G3FtL9B2a13wTuXnHXfswCxzGFlEZ8N/zibJY+kzvGKPvZ0Mx36OtfzlDBc0OBXtLDCJJ4dY/Mp7qJSdR6fbuD5iz3XyzYrJ+ph+pEQgoJMjEe3dtnTRkaahD0FuMnofY/1ZnnbKLOxL X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92c66c87-f94b-4557-21d2-08db7d30828f X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 08:19:10.6690 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MU2uMU7D8aLjecxTgIZI4WFRiUV6xPdmjTuo+t4uRlX6FpeSL2QFtJTyrJ1pUp1IaDLA2Z9/VfnCszY4DTWF9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5119 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li --- drivers/dma/qcom/hidma.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c index 344525c3a32f..b5e3633e6a5e 100644 --- a/drivers/dma/qcom/hidma.c +++ b/drivers/dma/qcom/hidma.c @@ -765,17 +765,15 @@ static int hidma_probe(struct platform_device *pdev) pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); - trca_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); - trca = devm_ioremap_resource(&pdev->dev, trca_resource); + trca = devm_platform_get_and_ioremap_resource(pdev, 0, &trca_resource); if (IS_ERR(trca)) { - rc = -ENOMEM; + rc = PTR_ERR(trca); goto bailout; } - evca_resource = platform_get_resource(pdev, IORESOURCE_MEM, 1); - evca = devm_ioremap_resource(&pdev->dev, evca_resource); + evca = devm_platform_get_and_ioremap_resource(pdev, 1, &evca_resource); if (IS_ERR(evca)) { - rc = -ENOMEM; + rc = PTR_ERR(evca); goto bailout; } @@ -785,7 +783,7 @@ static int hidma_probe(struct platform_device *pdev) */ chirq = platform_get_irq(pdev, 0); if (chirq < 0) { - rc = -ENODEV; + rc = chirq; goto bailout; }