From patchwork Wed Jul 5 13:51:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 699922 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 E098FEB64DA for ; Wed, 5 Jul 2023 13:52:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231820AbjGENwS (ORCPT ); Wed, 5 Jul 2023 09:52:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232369AbjGENwR (ORCPT ); Wed, 5 Jul 2023 09:52:17 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2118.outbound.protection.outlook.com [40.107.215.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50973F7; Wed, 5 Jul 2023 06:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WnfJ4xRP+z0VcxwjZN6ohwul72yqqiuLABs/wJlBZkdATFXqKQvcx4/9Zgrmmib6EdffRbLfYzcufsN51SNRPbnEx5wg3ktkFRSnxHPDXj0XgE6ogJ1Em4bpQDjK94o/oEmO0+xTSl/mc2eJ26Y5nwLNxyB4NazD8Vh0+a/asfwb2gGjSVlP8fH8tYjmdT+m5We/nKbRbj+9zhrf9/ezS5xifCDE6DRbIC0pnqmwsDKZE+xQ3fi+OuZCFIG1biFndLbpOu9UCahqsnN1jX+8f38JQn16F3gU2HNCV4gwo0Awud9GS+g5kyPEnMARFUAXimk6HjbQzQmv+QL2+W31Cg== 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=EtGdsGjKwrkleQHLRTgg+RRLnMhaS9ZoWfQWbgk0L7c=; b=cMbkh+w7osIdIk13lSsrREZwQs8gPyRrr15UtAbOOMCeFi1JJpThlJEzowaJvfHP/Fe5QKCOXgLF/gXJKWbApZB/Q0i2hkFtJcu/yffpbO2ZJQ8yBScy9fEFFSzH/1N3TNR15wcick91yK613HVzrErOw0tqmz2rN/NYa0T+o7/CjhG0qcAdnrgYSiPuHlXEq4HMMrKE1Jt+ymbMBgWQfUqeDv0SeGVLzNsnP/xwCgfyKLMigIQ7DZZDSavghqb7an6GOsz3MlxPJFFbbA73raY83k0NYw+OypS62WEr9dVqmQqJVaKaGGTV4enUFPQCKIxW0shy7/tE4Rns4y4/YA== 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=EtGdsGjKwrkleQHLRTgg+RRLnMhaS9ZoWfQWbgk0L7c=; b=HKRemG+ENqdt7dVRA2mBjkyahrKbYepDgpAuChfZOYQs0q50qN/rZrGaFmpnsd6XVJCYjO+/uv4n+3Ifj8WzaXUICTLR61DBycB1BZkfjjTDEx9EGRHf8bHDtIBWqrvopqxCqcsA0yh+KprExoOxJaZaiOnIciLDwVVqGqqrYQs/eqYDF8ZxFbj9Jk29kEn4oh0En75hh2NCkf/DjQryI/OYzxhK93U1Vug25UoE/o43ia0h5krhU1ufTdCXT/IzO6PFnHAhmZPB7PU75iLCKRLOEi5E72k1U+dUl+ouiU5/ZIEfO7pKi8YuKbj4lsmeXa3B4VUcTuL3emRb+ZVsQg== 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 PSAPR06MB3991.apcprd06.prod.outlook.com (2603:1096:301:38::9) 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 13:52:12 +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 13:52:12 +0000 From: Yangtao Li To: Khalil Blaiech , Asmaa Mnebhi , Andi Shyti Cc: Yangtao Li , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource() Date: Wed, 5 Jul 2023 21:51:51 +0800 Message-Id: <20230705135159.33327-4-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230705135159.33327-1-frank.li@vivo.com> References: <20230705135159.33327-1-frank.li@vivo.com> X-ClientProxiedBy: TYCPR01CA0049.jpnprd01.prod.outlook.com (2603:1096:405:2::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_|PSAPR06MB3991:EE_ X-MS-Office365-Filtering-Correlation-Id: ebcd374b-1ea2-4e9c-4759-08db7d5f0893 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6lIAyM6Awt8BstOHUogzl14fbzD8eT0DEe7vMj2IC6RG1OfAEeAcXKIJK2PGmyrUW7oQLMVeF7K2Iy3Cvs1GgkeAhz58DiSIbquxFrKvxbE2p04q2OjeDQlZBPF05TxcSF2lh4kI/w5Iedjv7pjLsY38IEt+6Z94E8c537JG/lKeQUFPnRqo12pl42HecgAvd4Wcl2e8DWT/cPvqcK076sclhKTaeqi2J/hQFHOEgo9OmNFjs8oLlae96XD6FC7QdxgIjVTkrwNLQzz7i31S1IjYBFGUJbblIQJyox25Yl+JrEOC4F85ld6VKxX3ExFiDhJdYtjZDF2CBPZb0Zm920pW3X7kBMeMAGCVvVlSB7cB8D5Wr8GRSLMn+CdMZBeIL0EYZnBnbL/Bq78o8MMqsgjfr952mVsSEvPyokBxxqz/sS885WMeapDP1juDx48QL/bI0I8bpje7ppWCDrfrXDERLc25a/rVJbhfwstV3hjSCl6EF39a+5XXYs7ps4eyFwu0661kgb1kBdp+u2qA736tpzifkVWrTTUTseQdlhuVsghalNsWRDJMOmGLSzg+Cu3WUPDYMgJo3opTFX6InLoojjqB0sfn/49KgwlXNuG2IWGLa9a/S5aqBJZEtBnn 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)(396003)(366004)(346002)(136003)(376002)(39860400002)(451199021)(38100700002)(38350700002)(66476007)(66556008)(4326008)(66946007)(2616005)(186003)(86362001)(6486002)(52116002)(6666004)(36756003)(6512007)(26005)(6506007)(478600001)(110136005)(1076003)(8936002)(8676002)(4744005)(5660300002)(316002)(2906002)(41300700001)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xbgiAKXcazg49we1h5s/GydwhtOU6olW+FqG0bvHQIZk++/5QPbxQZX/ZDUkBbpU2NIsbogy2iEnOd53ijHmcV1sisf9mlwK3M9w4dfmwO9sek4brbbXwiioUnLh81mgbSw+X5EmwETC/MeO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RYF4XzZ4o61KqCdotW6RQxsrG6VZBxh7N37+K/KTLuIbVz5q5aP+FRNTFBvYl4hBLCdkaheKgTWCEVvuF8DSiJL5PmV9IMM1iawOqzpyZnaMhG+VI3ct0kW+AQbvEQE8DsMd76Bsc+sO36DpzcUuXvoZyjvY2jpW3JM+vdzWtfSOSPDxERwj+/6z+Hlt2xMvfmlwsKHSvct48oa5NLGMhjattdPhqWdzN/Fd2swi65Qgn6UUHO3H2yZ9Tc3uk+/Qh75FAPQTZjD6RQU5kiqkJBHnvtOt0poUOAI55SriXZ2HtGAhZkS0/CVwXBTWOeYexhpk+eRg+51BKJsSrmaccjF+tIin1PpnBaJYvk4B4uAcL/wEAy1YbX67ab0 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ebcd374b-1ea2-4e9c-4759-08db7d5f0893 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 13:52:12.3873 (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: SsNZRu3U2bA1tSOkWXuslGdzCii94YVwpLlbjYlppgsbNaiI8GASC9SXtIIRhGctb3aocG7wmK1fRYdO91BCzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSAPR06MB3991 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@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/i2c/busses/i2c-mlxbf.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c index ae66bdd1b737..2f60e5532b54 100644 --- a/drivers/i2c/busses/i2c-mlxbf.c +++ b/drivers/i2c/busses/i2c-mlxbf.c @@ -1080,13 +1080,7 @@ static int mlxbf_i2c_init_resource(struct platform_device *pdev, if (!tmp_res) return -ENOMEM; - tmp_res->params = platform_get_resource(pdev, IORESOURCE_MEM, type); - if (!tmp_res->params) { - devm_kfree(dev, tmp_res); - return -EIO; - } - - tmp_res->io = devm_ioremap_resource(dev, tmp_res->params); + tmp_res->io = devm_platform_get_and_ioremap_resource(pdev, type, &tmp_res->params); if (IS_ERR(tmp_res->io)) { devm_kfree(dev, tmp_res); return PTR_ERR(tmp_res->io);