From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75F94C433FE for ; Tue, 22 Nov 2022 10:03:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232615AbiKVKC7 (ORCPT ); Tue, 22 Nov 2022 05:02:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232692AbiKVKCv (ORCPT ); Tue, 22 Nov 2022 05:02:51 -0500 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4CA66428 for ; Tue, 22 Nov 2022 02:02:44 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id B3E27240005; Tue, 22 Nov 2022 10:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1669111363; 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=WmyFTJevytlulznh6ayTXhdY+HEVUzYjYVjdJQwaGpA=; b=kS1KYIO/K9Qw33D72feMPlykFfp1HxvQj1V26Lb6RRxOCB9idxMwB+em7Z8mwV2QWDqqjw zEjaffLJqRaO4qaW1SDdRYf6VTfSm/gQ2P2ENT116NbcBkoI9VXRZZnq8jXFp1b4ZG7M2n H9baSI2sLX9o002cd4iavRrgVaOkdvCSsHaT7Hz2YFCDokKCOb181N7wBszHJkOFYnSwME s+c5pat0v+obwM/BzYdpSaPPdkXMjEMz+KwOg3znPsGKl6g9ul/lQR0nA7t5NrrMLuNi+I pYYWhvqAIulnfOKBPIOC3G/ukgSzqY+kiUDhWLu65y4xQiqqNzsiFT0jP3Jmvg== Date: Tue, 22 Nov 2022 11:02:39 +0100 From: Miquel Raynal To: Cc: , , , , Subject: Re: [PATCH] mtd: rawnand: orion: use devm_platform_get_and_ioremap_resource() Message-ID: <20221122110226.3cdac73a@xps-13> In-Reply-To: <202211220933274886024@zte.com.cn> References: <202211220933274886024@zte.com.cn> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, ye.xingchen@zte.com.cn wrote on Tue, 22 Nov 2022 09:33:27 +0800 (CST): > From: Minghao Chi >=20 Double space in the subject > 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: Minghao Chi > --- > drivers/mtd/nand/raw/orion_nand.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/drivers/mtd/nand/raw/orion_nand.c b/drivers/mtd/nand/raw/ori= on_nand.c > index 1bfecf502216..00bd7be76e07 100644 > --- a/drivers/mtd/nand/raw/orion_nand.c > +++ b/drivers/mtd/nand/raw/orion_nand.c > @@ -102,7 +102,6 @@ static int __init orion_nand_probe(struct platform_de= vice *pdev) > struct mtd_info *mtd; > struct nand_chip *nc; > struct orion_nand_data *board; > - struct resource *res; > void __iomem *io_base; > int ret =3D 0; > u32 val =3D 0; > @@ -119,8 +118,7 @@ static int __init orion_nand_probe(struct platform_de= vice *pdev) > info->controller.ops =3D &orion_nand_ops; > nc->controller =3D &info->controller; >=20 > - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); > - io_base =3D devm_ioremap_resource(&pdev->dev, res); > + io_base =3D devm_platform_get_and_ioremap_resource(pdev, 0, NULL); If we no longer use res, why not just devm_platform_ioremap_resource() ? >=20 > if (IS_ERR(io_base)) > return PTR_ERR(io_base); Thanks, Miqu=C3=A8l