From patchwork Thu Jan 19 09:19:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 45653 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp228437wrn; Thu, 19 Jan 2023 01:28:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXvD4B1DpQA7Tcb5wWHVnAmuzcpeuJWOPqedjmkelJAmzayB8s9XbHXqzd9OIZUGptUHgVpK X-Received: by 2002:a05:6402:27cf:b0:499:c332:3b50 with SMTP id c15-20020a05640227cf00b00499c3323b50mr13942345ede.39.1674120504200; Thu, 19 Jan 2023 01:28:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674120504; cv=none; d=google.com; s=arc-20160816; b=hu747Xg0GDe8PyvJoGvf8aPjZMnNnPE0Hm4WuyPMwqIZr2hNub0ORd9Kjws/VsRL12 MDsMYAuJnll9kKa8UtRJ2r5b+Oo1XTRpGmTO45yYVIS0mocBEKqAq09CHK0c2WLx2/+S BzcOofD79KdNuuvvYYN4PE15BRZHKTKT2FfCFBiNG8aeIXC1eFJsXZHwcRangRwf67OU +rVCZCqFLvFDFc2R0RX7wpX64ADtMvjdDiIhZ2zHA2StMknkKjllv0/vIP3tBpsfnBAG Y+nV/ToopODMbCt5LjJadHRNRh8flBDPeBR8WVfgbYSsxieBQ6tVBZLA1o8e+Rv3pFCl IAdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=RnaZ+w4Gx3Z1KyvumiYS6sired+wbPaZcUhjAyvQTEY=; b=H60Y7nVEwhTLTf7TjH9feYDo3215GKbD7jGSpy+dfuFvGH+cnpGuKvoPXut1V8w5Qy IXeX79Wnm6z0H13kHX8BIQhu/+cpFuQkBrUzkXHrKHqZXA+l2US6bO6bniH4qYPUAaWG +hk/j2oPtxT2MuBoftDWiJBsfG47TPj5QyPdS8bHy3112xXZPCqXKvSgIzKEGNQskShA H2NAKWWHPN9OtcdUO9MkfroK29ryNF8dtpv/JWXVvAP56i0/vSCEm47jS+HA9LbipGA9 B79Gg2CXC81HPNJltIHB/v3o1820IlmVnZWxNs9x+9sADb++ed8L/kDwKXwVdn3AUwGT oyeA== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a50d551000000b004782d6db359si37553737edj.146.2023.01.19.01.27.59; Thu, 19 Jan 2023 01:28:24 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbjASJUM (ORCPT + 99 others); Thu, 19 Jan 2023 04:20:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjASJUK (ORCPT ); Thu, 19 Jan 2023 04:20:10 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA31A53FAE; Thu, 19 Jan 2023 01:20:08 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NyHCW3JkTz501RH; Thu, 19 Jan 2023 17:20:07 +0800 (CST) Received: from xaxapp03.zte.com.cn ([10.88.97.17]) by mse-fl1.zte.com.cn with SMTP id 30J9Juto097433; Thu, 19 Jan 2023 17:19:56 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 19 Jan 2023 17:19:58 +0800 (CST) Date: Thu, 19 Jan 2023 17:19:58 +0800 (CST) X-Zmail-TransId: 2af963c90b3e09448b6e X-Mailer: Zmail v1.0 Message-ID: <202301191719589508843@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , Subject: =?utf-8?q?=5BPATCH=5D_i2c=3A_i2c-mt65xx=3A_Use_devm=5Fplatform=5Fge?= =?utf-8?q?t=5Fand=5Fioremap=5Fresource=28=29?= X-MAIL: mse-fl1.zte.com.cn 30J9Juto097433 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63C90B47.000/4NyHCW3JkTz501RH X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, T_SPF_PERMERROR,UNPARSEABLE_RELAY 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755442581791811467?= X-GMAIL-MSGID: =?utf-8?q?1755442581791811467?= From: ye xingchen 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: ye xingchen Reviewed-by: AngeloGioacchino Del Regno --- drivers/i2c/busses/i2c-mt65xx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index d80e59340d97..43dd966d5ef5 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -1366,20 +1366,17 @@ static int mtk_i2c_probe(struct platform_device *pdev) { int ret = 0; struct mtk_i2c *i2c; - struct resource *res; int i, irq, speed_clk; i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL); if (!i2c) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - i2c->base = devm_ioremap_resource(&pdev->dev, res); + i2c->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(i2c->base)) return PTR_ERR(i2c->base); - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - i2c->pdmabase = devm_ioremap_resource(&pdev->dev, res); + i2c->pdmabase = devm_platform_get_and_ioremap_resource(pdev, 1, NULL); if (IS_ERR(i2c->pdmabase)) return PTR_ERR(i2c->pdmabase);