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: 117645 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4827234vqx; Sun, 9 Jul 2023 23:49:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlHoCUEI/DyCZJlNupTj9IZ7pVkXfBKRmP7WGW9dlRwUwczh2M2e+fQDSUlF4Qu+D/yEooK4 X-Received: by 2002:a05:6358:7f05:b0:135:57d0:d170 with SMTP id p5-20020a0563587f0500b0013557d0d170mr1570125rwn.11.1688971792260; Sun, 09 Jul 2023 23:49:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688971792; cv=pass; d=google.com; s=arc-20160816; b=WiU5yUifE4IO12gXZDaPiPYnyui8hr4WSk6XArz9Lpw8j9qrnD3qOYjXyxRKHZsSzu FBbGpejQhhL+DWx3BhuPVhIzkEyQpkL+q/d2VPe2YU+4A8y1+2IK8dbxQNfCdpGoXsD9 e0zzfqXIcUPCMjYIelvHPX2H6SS4rZdGtBFr+82ZWWsMHfi38vrhniwncEbPZPiyz2q8 xxm+rVHLaZjmfFwTgOJYicwhHu7YSQLJfIZ11kq/lCMb0a0XsVtXyuDDddXy+1zN9kbT 58KGIxo24/OYvRsZHTKK6N43bUHA/hHKbl43rzzMg85TYRJ3AwAF8Ycrsj/cDToRWi1m FnKA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=0JhT7tYU77z/kX/T4rfE0ji973y3A2PxXUt6jegiMds=; fh=ntmLrBc5zigSZv3kkk0vkDFijpzSEx1J5jcUHbM5EMs=; b=x8pT92hTBF4kw8gyzY+xqZMSoU3jFAUb2yVFSJnkwh2SumO4KaFk2UkUlKLEtWOzVv rRFvAnjEW7lsGM17NwqV/WnksDYsLbcBsq7MMmf/643nifxKROTLSR/u6NIxHsSoVE4l gW0V0abF2fs4JnCiBhDDMQw+3tvP8jtBj7aIUM8pKzyy5yq/5uALEzc0hipHGjXxQUI9 uTaMcPkuo/N53aA1IUtUpwwRbyIksW926Jhp5ksHa2vsqnHfAXRoXi03WIJ6ZBDYGLWW jEtwzYcFXhIB1kcbhw8Z/YvkCOR/ccSNpFi+R0nkPDvdsgep7sJoMalov9Pz8owwiwe4 GN2w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=XOKEnIz0; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a056a001bca00b00682ad3438besi1175185pfw.214.2023.07.09.23.49.39; Sun, 09 Jul 2023 23:49:52 -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=@vivo.com header.s=selector2 header.b=XOKEnIz0; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbjGJGeV (ORCPT + 99 others); Mon, 10 Jul 2023 02:34:21 -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/b5f8Jpo09f76ZWLLPpxOdSzYcWN75u5J3FgCJK78AO+dMpM+gXJNqGuWKWh8NDqJrck+AtMIGCpq+fLYZs0ypz1lQeF6inJjKcr+HvVCLtv/lOmnKzmIgFupDKIJHzzaZKz7ZDgGw4F0uZpHPWGQSlwojZR/FNFXo+x7HYcBRcSIDZFyJ2rHrGKruMnliakSY4tSjlrk5b6AJhCyXCdQQRsB9TfQuFR/y0+i1XDfs/fvp4kQsU6JJIIqUuP99s/RBW5QK7Vr0inRU8hphNiZ9biWOOxkOZK/V2kFOq8YVZ1p1ewwG9ii8vsi++EJcskRpUo55i9JCIfuFZMd79VQfnG9UoUHuerqDGdEuLmwQP77reU2DAQuiLuUobrl5b7+R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ZK+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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: INBOX X-GMAIL-THRID: 1771015286064354319 X-GMAIL-MSGID: 1771015286064354319 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;