Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38283533rwd; Wed, 12 Jul 2023 05:49:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlHRe69SYk2b03HkzgO3F5yfCntfcMMU7bk+Mj7kLrrjg0oWws5pH3sD4qb0PmOA1OzKlj0z X-Received: by 2002:a19:4f10:0:b0:4fb:7c40:9f97 with SMTP id d16-20020a194f10000000b004fb7c409f97mr14126007lfb.27.1689166160437; Wed, 12 Jul 2023 05:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689166160; cv=none; d=google.com; s=arc-20160816; b=ktclTf1jmDrHHIBRf7ngxs2Ufn+7Nxy7eW4V2O2vcw2XMVrPvDhwLH5akK+2FmDvP0 YGKy2HvpArIQZjgBa8Wg5lKvF7Pz79n6HnPd2+2rj6LWFulM0gPupALRsKHAbcpIX9Ea ZbFKxHzRYBRWrmV5V/tkmdS7PU2FGOQjE2N2LQwS6IeNkkHxD7NfVbMWned8nXxy2hve u4IWVToHF9Onle3nJ9IXO4SgRSUUBuoBbyie5GRIIFkeg4DF69XSM8Jvkeg9OVsPs2Rw OTmG/84T1MkdkkfLw23+1U45AGYBB2uX1T0Su+0aDoNE6T6rGXJlK5weX/oz9KZucksN A5tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=UII/wsuuzjNZbpiAVeF6yDZcHsS9cuVB0V5RDHl93hA=; fh=MiMUbwVD3pgzveV14s54/PvSAPp8YyuNT6gH99NknpM=; b=oq5tdYRh+EMdKpNiZ/DXUIHkYxXx2P7QSsGDHB1fXjm+a/VYZu8pFRvproRCwYWCc/ V6PtSPodHR5T38MIcyKh647CtuPuXR7ZWBbZ3l1j3oUvjXqpW2TDK6hOSG/PXFqISqJQ xtAg2EhHOoOCY1KxWkkRcyJe1z2gHH2fzeF1jNaSyEvopSdCQ42NG6RJUE7EOi9C7WV8 h4tWqXlDaxQNDiJe30cnoCJfLbhyaD0GAX1YQgGIQSlnQN6cfrSABzN+4iOJIwoOme97 iFprug6z7ddqyZZgiWqjYNLTxVzjp2k88AXm63W8DqmGTvc0Tq9siMyY/6igdMATCYK2 xZwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jwaWI0SF; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020aa7c24f000000b0051dd4949cd2si4725251edo.408.2023.07.12.05.48.56; Wed, 12 Jul 2023 05:49:20 -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=@bootlin.com header.s=gm1 header.b=jwaWI0SF; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232879AbjGLL4k (ORCPT + 99 others); Wed, 12 Jul 2023 07:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233471AbjGLL4X (ORCPT ); Wed, 12 Jul 2023 07:56:23 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3F69213E for ; Wed, 12 Jul 2023 04:55:58 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id A21881C000B; Wed, 12 Jul 2023 11:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1689162898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UII/wsuuzjNZbpiAVeF6yDZcHsS9cuVB0V5RDHl93hA=; b=jwaWI0SF7ZVsRx+L0joo3eYJtnmAqCUL2W8brhepKTSZTXHTvzeDDGoWe9ZiQsiMDUwf7t hkFkCd5CO0qV7DbICAuhmh0+Uf08FN7I5YFKiEvtvnquH7CtW2B2KnKOBeP1Hq7jzhvmzA 316H3iefNRuN+nCWQY2l2T5BtUVu7Z6Smpt69xG9Z/yN2irBcGatyWeBzXLo1bqrlALgH6 s4tOCgd8K3mDSeojM7Ja/l/IcnCbxb39aVAxn366LEqokJ0Uea6mvUXij+l/n4uKeuFHM4 kyqMGliKSaKvuYYq2U+w16qkX7QNyEMYFsLBaK8GNLvj3QelxNM5d/FJGPwMOg== Date: Wed, 12 Jul 2023 13:54:55 +0200 From: Miquel Raynal To: Yangtao Li Cc: Richard Weinberger , Vignesh Raghavendra , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/18] mtd: rawnand: sunxi: Use devm_platform_get_and_ioremap_resource() Message-ID: <20230712135455.71fbeb5f@xps-13> In-Reply-To: <20230707040622.78174-1-frank.li@vivo.com> References: <20230707040622.78174-1-frank.li@vivo.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Hi Yangtao, frank.li@vivo.com wrote on Fri, 7 Jul 2023 12:06:05 +0800: > 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. >=20 > Signed-off-by: Yangtao Li > --- > drivers/mtd/nand/raw/sunxi_nand.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sun= xi_nand.c > index 9884304634f6..db36bd755b8d 100644 > --- a/drivers/mtd/nand/raw/sunxi_nand.c > +++ b/drivers/mtd/nand/raw/sunxi_nand.c > @@ -2087,8 +2087,7 @@ static int sunxi_nfc_probe(struct platform_device *= pdev) > nand_controller_init(&nfc->controller); > INIT_LIST_HEAD(&nfc->chips); > =20 > - r =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); > - nfc->regs =3D devm_ioremap_resource(dev, r); > + nfc->regs =3D devm_platform_get_and_ioremap_resource(pdev, 0, &r); Why do you keep a reference over the resource? Why not just devm_platform_ioremap_resource(pdev, 0) ? This comment is valid for almost all the cases in this series. When the resource is only needed in an error printk, I am also in favor of modifying the error message to avoid having to grab the resource. > if (IS_ERR(nfc->regs)) > return PTR_ERR(nfc->regs); > =20 These comments apply to the 18 patches. Thanks, Miqu=C3=A8l