Message ID | 202211101723428058432@zte.com.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp40750wru; Thu, 10 Nov 2022 01:29:29 -0800 (PST) X-Google-Smtp-Source: AMsMyM7bbuGMaZPuUI1NruA+AOH9XEaB0YniO+2M1jcb0Ve8h9i3jevGfTdaqOPeLPiNFPIwSafB X-Received: by 2002:a05:6402:d0b:b0:458:a244:4e99 with SMTP id eb11-20020a0564020d0b00b00458a2444e99mr62526731edb.46.1668072569066; Thu, 10 Nov 2022 01:29:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668072569; cv=none; d=google.com; s=arc-20160816; b=oC/EqApCjrbSmr1f4U0W5lff2Oyn/Ih8KEsvq9VJGF6Rz1xcXP5PjO4tJJRuh7C+uU fC1/9NCoc+3pOoQIKNz5ctbr5zkMM7kS78L2ls6ZBqSwNVJJ8SGESOK1s6MjRc/DeGK1 MGqEc7P4syfw/ZGmudNPXg3rZakc46NLlhWfAwt4gA2GF1rfxf/87cC/fy1YCJX4InlU lzM3gN2nwHDD22jidnBa3UBD+AFjyq0z7qT83RPZ+dd8LxzWkAa5R8X7xwXwGM6ti9yw LWkmIp1kx5YDdNrQ2yQ7LLvAQBYMC/UI7DnMU5OwVm8J4z9y8jcsxePiP2vPCtjEnlYs Xh4Q== 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=MC8KTveD7uIqs3xgL/Eg63zrW8B3h5Umi9NF01k9/w0=; b=z+BbnzEsGhbxFQAsmROejWk4z2xBS6ZTG5MJe6oRHsZ4Z8L/RyVnWB1qxogxjXIvxy x17S2XW2q+um4xbgHyXQjETD9HfQ6bd70zkcuk646g+torVdQXtUg1ap+wGBUghoqUuo ovGYgsI4NvddJKqroSXrl01bNuuI2SzsjF4OhtXJIpyNZrpk70bySXEKxSjlI6o6bmpE YJLJMyKmOLMGgikUod3cW7sU08WCAwf0Adn637NKE4d96byWiPqD1q/M1tfh5iZTTETZ TjKjQbClV6K5umJmQrSmQsPBgvKcupjL0P2hkus8w8m2awD+3N+bMwZUPdaN0u0cbovT XQYg== 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 hs7-20020a1709073e8700b0073d9ea386d4si15478478ejc.983.2022.11.10.01.29.05; Thu, 10 Nov 2022 01:29:29 -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 S229861AbiKJJYF (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Thu, 10 Nov 2022 04:24:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbiKJJYE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 10 Nov 2022 04:24:04 -0500 X-Greylist: delayed 1815 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 10 Nov 2022 01:24:02 PST Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E69CBDF50 for <linux-kernel@vger.kernel.org>; Thu, 10 Nov 2022 01:24:02 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4N7GcK0MQnz4xVnk; Thu, 10 Nov 2022 17:24:01 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2AA9NeBE000821; Thu, 10 Nov 2022 17:23:40 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid31; Thu, 10 Nov 2022 17:23:42 +0800 (CST) Date: Thu, 10 Nov 2022 17:23:42 +0800 (CST) X-Zmail-TransId: 2afa636cc31efffffffff0d0f058 X-Mailer: Zmail v1.0 Message-ID: <202211101723428058432@zte.com.cn> Mime-Version: 1.0 From: <ye.xingchen@zte.com.cn> To: <linux@rempel-privat.de> Cc: <kernel@pengutronix.de>, <shawnguo@kernel.org>, <linux-i2c@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <chi.minghao@zte.com.cn> Subject: =?utf-8?q?=5BPATCH=5D_i2c=3A_imx=3A_use_devm=5Fplatform=5Fget=5Fand?= =?utf-8?q?=5Fioremap=5Fresource=28=29?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2AA9NeBE000821 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 636CC331.000 by FangMail milter! X-FangMail-Envelope: 1668072241/4N7GcK0MQnz4xVnk/636CC331.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/<ye.xingchen@zte.com.cn> X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 636CC331.000/4N7GcK0MQnz4xVnk X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749100862262455534?= X-GMAIL-MSGID: =?utf-8?q?1749100862262455534?= |
Series |
i2c: imx: use devm_platform_get_and_ioremap_resource()
|
|
Commit Message
ye.xingchen@zte.com.cn
Nov. 10, 2022, 9:23 a.m. UTC
From: Minghao Chi <chi.minghao@zte.com.cn> 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. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> --- drivers/i2c/busses/i2c-imx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Comments
Hi, On 11/10/2022 2:53 PM, ye.xingchen@zte.com.cn wrote: > From: Minghao Chi <chi.minghao@zte.com.cn> > > 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. > > Reported-by: Zeal Robot <zealci@zte.com.cn> > Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> > --- > drivers/i2c/busses/i2c-imx.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > index 3082183bd66a..1ce0cf7a323f 100644 > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -1449,8 +1449,7 @@ static int i2c_imx_probe(struct platform_device *pdev) > if (irq < 0) > return irq; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - base = devm_ioremap_resource(&pdev->dev, res); > + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); > if (IS_ERR(base)) > return PTR_ERR(base); > LGTM. Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com> _Mukesh
On Thu, Nov 10, 2022 at 05:23:42PM +0800, ye.xingchen@zte.com.cn wrote: > From: Minghao Chi <chi.minghao@zte.com.cn> > > 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. > > Reported-by: Zeal Robot <zealci@zte.com.cn> > Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> As res is used later, we cannot switch to devm_platform_ioremap_resource(), so the patch is fine. Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Best regards Uwe
On Thu, Nov 10, 2022 at 05:23:42PM +0800, ye.xingchen@zte.com.cn wrote: > From: Minghao Chi <chi.minghao@zte.com.cn> > > 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. > > Reported-by: Zeal Robot <zealci@zte.com.cn> > Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Applied to for-next, thanks!
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 3082183bd66a..1ce0cf7a323f 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1449,8 +1449,7 @@ static int i2c_imx_probe(struct platform_device *pdev) if (irq < 0) return irq; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(&pdev->dev, res); + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(base)) return PTR_ERR(base);