From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiM7f-0004M9-4Z for linux-mtd@lists.infradead.org; Wed, 25 Jul 2018 15:54:44 +0000 Date: Wed, 25 Jul 2018 17:54:21 +0200 From: Boris Brezillon To: Miquel Raynal Cc: Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , linux-mtd@lists.infradead.org, Wenyou Yang , Josh Wu , Stefan Agner , Lucas Stach Subject: Re: [PATCH v5 10/17] mtd: rawnand: jz4740: group nand_scan_{ident,tail} calls Message-ID: <20180725175421.6b002369@bbrezillon> In-Reply-To: <20180725133152.30898-11-miquel.raynal@bootlin.com> References: <20180725133152.30898-1-miquel.raynal@bootlin.com> <20180725133152.30898-11-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 25 Jul 2018 15:31:45 +0200 Miquel Raynal wrote: > Prepare the migration to nand_scan() by moving both calls to > nand_scan_ident() and nand_scan_tail() in a single spot. > > Signed-off-by: Miquel Raynal > --- > drivers/mtd/nand/raw/jz4740_nand.c | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/drivers/mtd/nand/raw/jz4740_nand.c b/drivers/mtd/nand/raw/jz4740_nand.c > index 3abf87420c10..09541608a45f 100644 > --- a/drivers/mtd/nand/raw/jz4740_nand.c > +++ b/drivers/mtd/nand/raw/jz4740_nand.c > @@ -309,6 +309,7 @@ static int jz_nand_detect_bank(struct platform_device *pdev, > size_t chipnr, uint8_t *nand_maf_id, > uint8_t *nand_dev_id) > { > + struct jz_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); > int ret; > char res_name[6]; > uint32_t ctrl; > @@ -335,8 +336,19 @@ static int jz_nand_detect_bank(struct platform_device *pdev, > if (ret) > goto notfound_id; > > + if (pdata && pdata->ident_callback) > + pdata->ident_callback(pdev, mtd, &pdata->partitions, > + &pdata->num_partitions); > + > + ret = nand_scan_tail(mtd); > + if (ret) { > + dev_err(&pdev->dev, "Failed to scan NAND\n"); > + goto notfound_id; > + } > + > /* Retrieve the IDs from the first chip. */ > chip->select_chip(mtd, 0); > + You add an empty line here for no reason. Other than this tiny detail, LGTM. Reviewed-by: Boris Brezillon > nand_reset_op(chip); > nand_readid_op(chip, 0, id, sizeof(id)); > *nand_maf_id = id[0]; > @@ -456,17 +468,6 @@ static int jz_nand_probe(struct platform_device *pdev) > goto err_iounmap_mmio; > } > > - if (pdata && pdata->ident_callback) { > - pdata->ident_callback(pdev, mtd, &pdata->partitions, > - &pdata->num_partitions); > - } > - > - ret = nand_scan_tail(mtd); > - if (ret) { > - dev_err(&pdev->dev, "Failed to scan NAND\n"); > - goto err_unclaim_banks; > - } > - > ret = mtd_device_register(mtd, pdata ? pdata->partitions : NULL, > pdata ? pdata->num_partitions : 0); > > @@ -481,7 +482,6 @@ static int jz_nand_probe(struct platform_device *pdev) > > err_cleanup_nand: > nand_cleanup(chip); > -err_unclaim_banks: > while (chipnr--) { > unsigned char bank = nand->banks[chipnr]; > jz_nand_iounmap_resource(nand->bank_mem[bank - 1],