From patchwork Mon Jul 10 06:33:40 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: 702087 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 11EF9EB64D9 for ; Mon, 10 Jul 2023 06:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231195AbjGJGeT (ORCPT ); Mon, 10 Jul 2023 02:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230392AbjGJGeM (ORCPT ); Mon, 10 Jul 2023 02:34:12 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2121.outbound.protection.outlook.com [40.107.117.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CA38186; Sun, 9 Jul 2023 23:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XBwalNO8UEMWZRFsETEckb6WDxLzH1xJHHaP9JEW3txUtuVdyDOuLv29UBWCTZVD3bUndDN/2opKBxwRCWQYQ9o0nhKXXlUJI0pCCYez3gDVmLdH4mm8gLQ9uf/RgfiVBigxTTkVbxsAzBBQHHE4rk2ihRXjQGHU9e4tBFEHHcVQkKK+yY4UouxAwDChePZcngwKCkIDW4TGffvfuAvC9/tfCZmDzT2ll0x9JV6a1ChNvKAl4VQuXkFotoIFT/vCch3DuxcitdFCkjWkA4+HgrJrgPDLvLJmFjVxg0LCciZsUTLsDgBfCya0L6NW4YcXm9ryHD47pMCJLJWbCc0jHQ== 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=0JhT7tYU77z/kX/T4rfE0ji973y3A2PxXUt6jegiMds=; b=V/yIi4Cjz0NAESwdv1BvHT16wTn1mrGdZyG2Mmhbr6zOwe7l4alKc7WDwS4JKx7vfj8oGxaWxwTM70ENMI+n5tnlXluPLpfXPxhKkFhfOoMM82KOcTKQhU0HzWb3u3if0OLsj6i1LL2zTdfgP7CLKK9JnY+DGx5KmpvJJgImRo6Elf7uojgkzrtSXQMqMciAFvO6a+/JnxPKmZm6o+v9ZbtsgwgX7lilkTAafWh+Ryn8Oh1jTpj5rGuIYFmApjn3TSOiHbvQfl35noDtaqGa53mQ2tKPY4+50PlMZeS/SP/Ft/RfdMdQ/7xanhBDXz95lmUwbRTJTP0DeQDDZlGEMQ== 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=0JhT7tYU77z/kX/T4rfE0ji973y3A2PxXUt6jegiMds=; b=XOKEnIz0TMc8wgSA28QhG2qCIu4yIy/Detdm31ZLuXQZr5ZhbuOgdyxnNrMOgPfR89iu8nIbwcKPicu1+DIc9Ro/I19a8E7hJaEIjWMwx/EJH8s6r/ZgANukouKN/BdvNUILaiJsyKGAu3E1nayZMvvx6rIrRDjMdPOwZa1VuUExFmN3K2mvfkWb5DadxIdwx5zzwEEl2jlJ1mpZFqsBwNe/7l840Ki8u/vQYWXja6VI2syxN2J+6/Oj8nAPnjdaYy/dfJiYyEQhCH4G0ClDyGDId7FrwVyErXVRfcLnh3Qi4apQrkLCgGNxKMBwSFatcbjeHUkQ6dfisYcR/Cgihw== 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 SEYPR06MB6586.apcprd06.prod.outlook.com (2603:1096:101:175::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 06:34:02 +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.028; Mon, 10 Jul 2023 06:34:01 +0000 From: Yangtao Li To: Codrin Ciubotariu , Andi Shyti , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: Yangtao Li , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Date: Mon, 10 Jul 2023 14:33:40 +0800 Message-Id: <20230710063351.17490-1-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SI1PR02CA0021.apcprd02.prod.outlook.com (2603:1096:4:1f4::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB6586:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d686045-ab26-46e6-4bb9-08db810fa61b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k3+MPNp9eSdvVWwno9NN5vLGLWTAlVlMBB2Pr3DRDWOeazPO32nu444Em3EqGa5q3XwqqT/lHGT0vkcPU/xXrPVgNDjqLhaq8tYENvnx+2R1QrAMDki/sStmOMpDV6qmdvmyA1y+/Jl56tJV80KYhdFITQKjRJI23j2Xg7g7BipLC3pjq3uy7Pgfe0KnM4LqXPc8+kdrISc0Urm8EnjtKEI2E+dCZXADrUtkOsuEiO9D2A/cYlvtXt9VrNdvw7aQDFhYGhfbi1rVwL+hRReHy4ApdKJGY2xMQbs/IOBkhpCO4cOGfPDRBqNrNiOPvjFVMS8PK4zBeG/IKVcSnre/3Gw3+3lFxgNSV1VWVO5kwixh8MZrAiVrlTITeOhPLhRGt7eaABu03UQ+rInRxQLCQHjTWKmcbT6u50S4kiHLu5AnhGSnC90TxsluxfyU+nIluH90Qv+B9D2vWABw6jA21cdr/nHoYVmqoqRRwAcyOPe4EScCKjCLj04Fd5KEYH1gk1vz5bNjZEx8xrv1H4ysaw9/oVOpltJ2lJqsy0G7fsB4Kjwi+cezpVZMCRvjs+lMxUTqwusvlr/4GrezBasGC+DckA4onSrqIv8N0vkV8jUo/j8A+aXKbpL0kmCC9GJc+DMIe0cc2AE9ax9SjeC+LGgJhgxp0Zc0fqe/eDEOZnc= 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)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(52116002)(6486002)(478600001)(6666004)(110136005)(83380400001)(36756003)(86362001)(2616005)(2906002)(66946007)(186003)(6506007)(1076003)(26005)(6512007)(38350700002)(38100700002)(8676002)(4326008)(316002)(66556008)(66476007)(41300700001)(5660300002)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HbrzDYhMfQA8X60ojhuaCFe7d8QnwPq+RJ4UQL94z77GL244bdQF0W/b5f8Jpo09f76ZWLLPpxOdSzYcWN75u5J3FgC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R38TpcmljgKM35Vcpxvz0cggZCOycPuI/lQemjB7c1NRe9GQJdJGINKT6HO3Oco1HXzPBojp6UwSJXfVBsldiRKNtcmiq4V5lSf4VYNG+z3dLFpc8uat+Wgmt+96BaGFYDrm68ngHpE2jo0BLg/ZAwSnj/UGZL44LiMDT25q3tucLjVHBCtWOQW4ij81j1uCIyPi+egUtSfdGubFV7mbT+xla3rCQ1XpzGI9yLU8B6k7KUFqJ2IH1vvIV/A62gVtV3jr4gW2RYJJVaQ/GD4yTCJi4FWSBHlBttjYf0tfDNUyB0PgkKik+Z2g5Di01qJ9Cv0T8+ee74G50O3Asmeo3wGiIPNG/8ZK+2YY5+8LSO8tYe93b5CQtN1ukJLWMNqI3ZeyWgHfhc3frssm1OQMmkORyEZRI36fGuXFKlgq6jkKj57GUi X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d686045-ab26-46e6-4bb9-08db810fa61b X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 06:34:01.6875 (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: gnsB5Y3IdgUWq6/4zvsumvNOmfXslMMBNkf0kInwUdhCeHTx/edM086UOvbG6NWsS46vtaQYYy0hu9i7FDAzlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB6586 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 Reviewed-by: Andi Shyti --- drivers/i2c/busses/i2c-at91-core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c index 05ad3bc3578a..de3b8f1053e7 100644 --- a/drivers/i2c/busses/i2c-at91-core.c +++ b/drivers/i2c/busses/i2c-at91-core.c @@ -207,19 +207,15 @@ static int at91_twi_probe(struct platform_device *pdev) dev->dev = &pdev->dev; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!mem) - return -ENODEV; + dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); + if (IS_ERR(dev->base)) + return PTR_ERR(dev->base); phy_addr = mem->start; dev->pdata = at91_twi_get_driver_data(pdev); if (!dev->pdata) return -ENODEV; - dev->base = devm_ioremap_resource(&pdev->dev, mem); - if (IS_ERR(dev->base)) - return PTR_ERR(dev->base); - dev->irq = platform_get_irq(pdev, 0); if (dev->irq < 0) return dev->irq;