From patchwork Mon Jul 10 06:33:47 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: 117646 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4828263vqx; Sun, 9 Jul 2023 23:52:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlHqtdWbVdPjm9KE64NZnEuccu7MAzBWPu36VJfmDkMfONv+BYMiq593cw6GuXCS6AnLdYAI X-Received: by 2002:a05:6a00:a1b:b0:682:713e:e520 with SMTP id p27-20020a056a000a1b00b00682713ee520mr12349802pfh.8.1688971932451; Sun, 09 Jul 2023 23:52:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688971932; cv=pass; d=google.com; s=arc-20160816; b=tPE6U5imJ611cPMpfJoEtYqihkCPfQLfxOPhahz5l7HJKeBRIwSSGZo86/M/dLzGK3 XWy995+39HPV09ZizMdqYwSU4OXl5GEUFLN0RAGPgs7OAT4riVk7kLXJehVGRVW7UJ+p OOLq3eHZHxP0iMjED3jPf04qBlM3lnzaewTebabhM4l89jCB2r1jCwmdBlaLMRapF7tb /DsVp29JrSLW+VXwlGUmiV4lKTqJRyKAIIBfNphUQgReZCQw/1cdPCASWQGha/FYXAw+ PvfDh4N1Y6056T5+lMirLK8+MJkASH01zwvycG2xzQaTc2vXE68b+JzreuBaEyLgiyx5 rR7A== 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=wEXyr7CCnTvij27+1OkJm+eQgTyZidz8WdhtGo6ZdJ8=; fh=JYjSTwuChLL5YgjTRwagGtyipnbAP68EpgrQTyoo4Ak=; b=l4kQT1DxvHw3w0zvcuuwwj+hmVNzeGWQd4+bLBGP3prrvx34TsR5zBNAL0UCtNNLVq 4jOvgRDuvYns7RohwT2Np/lvRKJtz4otx4+JvLsxfIFP/buYV02Ietp0aq2c1QLAAZll fntJ7zsVgmhBTgmh8g5F+iblCW6Ot+vl4Le+ez8vu15G7v9V3v3T2msDcwuwVRqY6BW7 R30dPwSPTlB1a3DFK9bjE5ik6FWZDC5ofay+iFqkTlkbHeZByHvPrpG6jOMHQYfEoUeF wEfFmSxQg7Y+dAVChaeL9i8AuWZkQM8BnBO70Ln91pZvwvZ2gYLhAQ3jh7gZH6ZAfr++ 5SEw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="Wf4f/HCQ"; 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 o7-20020a056a0015c700b006824cda542fsi8752573pfu.395.2023.07.09.23.51.59; Sun, 09 Jul 2023 23:52:12 -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="Wf4f/HCQ"; 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 S230021AbjGJGge (ORCPT + 99 others); Mon, 10 Jul 2023 02:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231497AbjGJGgR (ORCPT ); Mon, 10 Jul 2023 02:36:17 -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 91BD719A5; Sun, 9 Jul 2023 23:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JoKXb4jnSD46YZDyEscHSQi1wlyYh1R+Wi50tkyzF4dLrxmaqgDOy0ukmu5O6WgZLX9iGKkr4kWxPPG95oF0BtPlXzV9m/rLCRvTrjkO3b95XsbCzMc5PomLJ9hK2hA+gyQBlUtKkClVOtzq+30weq2vtzyiOBuwfqvSuJaUQUAirBkLGT3XIsiUB7gtUZQZt/1g6joRzkf29umuZVXUF+NLmPsv4jqtau3V2FNgT1vJbqNsMcIXlD2c/+8wXY2/VR6ieRUDbX3t2lkZkOf6StyLfgq9Ks75Dv/iZmLs1SnlVJ6BK5PuAD1T8WPK07ncSkHkQ9C84aEWSicnPy+Pog== 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=wEXyr7CCnTvij27+1OkJm+eQgTyZidz8WdhtGo6ZdJ8=; b=Li1MkXXfyZBe7jttdrWVHfKcspf+mzulPi52Is9Clxj70fjptxV2nhBEE0dHDs/v2l0MEGKJVBODeN1PLNbwQbH0cc6ka85UxjB7SbHaLmqEPwQToIFDqWk3NnyOqfFXDYMgr391+MpJ1ZEDDSx+UvonIBwRWuv8UtK3U9XAKoJ9gnZe2n20y4eC5/z5KA5q2+s8WTgB9iuLJCBHP4Rmdcr+/jp0jQE0vsSL7kfVsgQR0rb8qB7rgWqigVt3peNzVclKU8BRdMl0zKeft9NGPlu8psmEgay4nhxVmHYQ8iR8DMtYy8BzzmLeFpRtNCwvDQEUJfHa26Yjc8JRotT47g== 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=wEXyr7CCnTvij27+1OkJm+eQgTyZidz8WdhtGo6ZdJ8=; b=Wf4f/HCQrc3hcoaW4UE6cG4oX6mykvErsvVOas2dBIMYTq/w2BoeNBjXPh2dqkvVgocgWG8nhBYUKO+viwyyUhZLKq6qfEzHxFZXyt/KNLLJMEZOt96TCU5WjxGE82Vib1moXf1tlTGgwOs8U5jvANGV4hnzJUJOk0VZiDdqPysyy3ZtOooPFLGZ1NWvF54azbT24e3RKVg/xcaK+3GYvFHB8GqwrpEXfZZgfL/NDNUyvF65tleVPeam5p1h++Gy/yRp1tm+XprJbCR1ht1aDCYhCdSPkeps+eB6dn5WwHNf5W6uCD0IWZM1lhLbkG6by9u1nYrwU2sGWCVcjYztmQ== 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:19 +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:19 +0000 From: Yangtao Li To: Wolfram Sang , Andi Shyti Cc: Yangtao Li , linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource() Date: Mon, 10 Jul 2023 14:33:47 +0800 Message-Id: <20230710063351.17490-8-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230710063351.17490-1-frank.li@vivo.com> References: <20230710063351.17490-1-frank.li@vivo.com> 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: d3b6e916-187b-47cf-b256-08db810fb086 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Miln90ZK7E1yzZ4TTPEU30fV5Z1rOzBGw16wnXr7wrSsELX0XSxy7bwZHkNMuE22Glw6wMCMXXROY/1emGljzouEusrg9aiuso9cnEArqeQl1bMlBRqZTgb4yKvyEsvhq6pn78/dPeNmb2YFyTr7/+N4gxo3nQKHSaF8h8A/KA/7QvMxwcrQLTYrvo164KpYRyXOKFo6pvun73S3LHHbXNYcQXH5zLSIqSjUQK3rI9pPHjeQxH8kjhJ+9Ddn6HgNLAxTfCi2QpsJPBT7C3EZDv1NM98uBNL8nRh+1Bcu3nV/evI0QOc0kly2LF/t+DaVxwqZzgOYz4p+AS98A5fhwdnSM2ZamtRHvVRTmrZWK4Y8vSf6iuoeAUuy6IiieYYRmXEP0bP347IrRbiOHpjM8FUoXM9tdbCR6uITq3CLObO7oaA2VeFdEyqHJDjQVrshGeerPqNBguANX9bcTqDjX9fnqTa/074w3n5RwjsEQxtwI5MiqJL7jRo67BnSVvghinfr1hkW7rII0mmw1AtQCg0pmOibdfUJXK39taNR3zy8YV+HCtLyFtdIn5DEurc3YhPLQYyeWafaf0lm4RpRxOeIme4gSFDoAIEqEwYiM/l3hddSGwYG5O5Wb8vNZ4HpkzNSoNKfHr+f8ULapTYEqs2KBc+VMWmNUSaVC9hy6gQ= 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: rAqrp5Bdwi2IDHV+kkeD94DcChMx2uxlQL8wc+S5zKKQ1xcERVYgWAjW+Zh3T4mUDtJN8879n7nBaJ68N5IVbcwu8YvY4H20V4579GELFpZIKqG/KItShgt7lMPaPV4DtML0xCFo+Jf7LDyzW9ZmFllxCDqCb1AZAk+vGaa4Igxl9YWimCrCCS6BESt7qNXJw+deSAkSC7Lu3ZPfcpDZTPAonbICTBP6OeKFicl1JX04TMm+jP4nPdditPQ8zgPjLQRsxQBFI/eKzRgG5fKcth+coDZL2vR0zPWsDowM0AuzoieKTW/D4CHejhLuDelulTipu5h7ES9BFDUxGgOFTDxS2M/2dTo+N91NgjdxwU0keD1itdmxGdxFJ67uZeTpM8zVdpbxYl50FUuTq7gon6zZrJOSdSreQ6hvLe7cB/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RAI+SHEzLqByeGLsGk5vwcMDtRyrmAkAS9sQPt8Pe5fLf0wf0tra7KP6zO4n3nILRA9En3khg2kBLoYk X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3b6e916-187b-47cf-b256-08db810fb086 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:19.0755 (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: 6sQQ9iHIdsMAri/UivAQTCJ3YrJpMz8cLpYBAJGAI2NkP3URMD710iwzbB+fBfwfFr0yBhWnR3/MMfIZ3n/+OQ== 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: 1771015432777176726 X-GMAIL-MSGID: 1771015432777176726 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: Geert Uytterhoeven Reviewed-by: Andi Shyti --- v2: -s/devm_platform_get_and_ioremap_resource(pdev/devm_platform_get_and_ioremap_resource(dev drivers/i2c/busses/i2c-sh_mobile.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 21717b943a9e..163fc118873f 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c @@ -871,7 +871,6 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) { struct sh_mobile_i2c_data *pd; struct i2c_adapter *adap; - struct resource *res; const struct sh_mobile_dt_config *config; int ret; u32 bus_speed; @@ -893,10 +892,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) pd->dev = &dev->dev; platform_set_drvdata(dev, pd); - res = platform_get_resource(dev, IORESOURCE_MEM, 0); - - pd->res = res; - pd->reg = devm_ioremap_resource(&dev->dev, res); + pd->reg = devm_platform_get_and_ioremap_resource(dev, 0, &pd->res); if (IS_ERR(pd->reg)) return PTR_ERR(pd->reg); @@ -905,7 +901,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) pd->clks_per_count = 1; /* Newer variants come with two new bits in ICIC */ - if (resource_size(res) > 0x17) + if (resource_size(pd->res) > 0x17) pd->flags |= IIC_FLAG_HAS_ICIC67; pm_runtime_enable(&dev->dev);