{"id":949186,"url":"http://patchwork.ozlabs.org/api/1.2/patches/949186/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/patch/20180725133152.30898-11-miquel.raynal@bootlin.com/","project":{"id":3,"url":"http://patchwork.ozlabs.org/api/1.2/projects/3/?format=json","name":"Linux MTD development","link_name":"linux-mtd","list_id":"linux-mtd.lists.infradead.org","list_email":"linux-mtd@lists.infradead.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20180725133152.30898-11-miquel.raynal@bootlin.com>","list_archive_url":null,"date":"2018-07-25T13:31:45","name":"[v5,10/17] mtd: rawnand: jz4740: group nand_scan_{ident, tail} calls","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"9bc68bfdc9a4c844f177a81de88abf6ff3ffd387","submitter":{"id":73368,"url":"http://patchwork.ozlabs.org/api/1.2/people/73368/?format=json","name":"Miquel Raynal","email":"miquel.raynal@bootlin.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-mtd/patch/20180725133152.30898-11-miquel.raynal@bootlin.com/mbox/","series":[{"id":57526,"url":"http://patchwork.ozlabs.org/api/1.2/series/57526/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/list/?series=57526","date":"2018-07-25T13:31:36","name":"Allow dynamic allocations during NAND chip identification phase","version":5,"mbox":"http://patchwork.ozlabs.org/series/57526/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/949186/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/949186/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org\n\t(client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=bootlin.com","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"U9ly4E0/\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[IPv6:2607:7c80:54:e::133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 41bGQL4dctz9s4w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 25 Jul 2018 23:33:30 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))\n\tid 1fiJus-0001fx-AZ; Wed, 25 Jul 2018 13:33:22 +0000","from mail.bootlin.com ([62.4.15.54])\n\tby bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))\n\tid 1fiJu4-0000Ky-To\n\tfor linux-mtd@lists.infradead.org; Wed, 25 Jul 2018 13:32:36 +0000","by mail.bootlin.com (Postfix, from userid 110)\n\tid 8385D208FF; Wed, 25 Jul 2018 15:32:17 +0200 (CEST)","from localhost.localdomain\n\t(AAubervilliers-681-1-78-122.w90-88.abo.wanadoo.fr [90.88.20.122])\n\tby mail.bootlin.com (Postfix) with ESMTPSA id 27DC220908;\n\tWed, 25 Jul 2018 15:31:59 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:\n\tIn-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=LgdvH0362x0kUfzzi994FScyckJjfwuVeLdZeewM3lE=;\n\tb=U9ly4E0/P/arXhugjjClKxacuQ\n\tDZGqi0XZtw56W+U5PCNBnV+222MFI/J5JrfcJUj+rJJaFTWBBOwuC0tuxspVYBdPpPFKHa1oRgqmY\n\tUy0zHiPc4Q6zI4VKtaGuTSTjGMRDlYWsrInSGfZa7JqLtaYRiCjVQLuGUSvdtxgqddjegJ0IaIKnd\n\thMMzs8R052fVaqDEaAeAz04k93UdvDTA+L1KRJ2xzNaF2S6FcJkus8ueQUiuFHtY3xksB/H3Bptza\n\tEC9jq0rgr+kR2Ot55pz7G6sdwI6k3Ca5LrLC5tc6Qdf455sg+9FzM5FYQdFV7UGpsY9Qfo3huayp3\n\tsR9y3zJw==;","X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","From":"Miquel Raynal <miquel.raynal@bootlin.com>","To":"Boris Brezillon <boris.brezillon@bootlin.com>,\n\tRichard Weinberger <richard@nod.at>,\n\tDavid Woodhouse <dwmw2@infradead.org>, \n\tBrian Norris <computersforpeace@gmail.com>,\n\tMarek Vasut <marek.vasut@gmail.com>","Subject":"[PATCH v5 10/17] mtd: rawnand: jz4740: group nand_scan_{ident,\n\ttail} calls","Date":"Wed, 25 Jul 2018 15:31:45 +0200","Message-Id":"<20180725133152.30898-11-miquel.raynal@bootlin.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20180725133152.30898-1-miquel.raynal@bootlin.com>","References":"<20180725133152.30898-1-miquel.raynal@bootlin.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20180725_063233_398209_C45956EC ","X-CRM114-Status":"GOOD (  14.25  )","X-Spam-Score":"-0.0 (/)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-0.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno trust [62.4.15.54 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"Lucas Stach <dev@lynxeye.de>, Wenyou Yang <wenyou.yang@microchip.com>,\n\tJosh Wu <rainyfeeling@outlook.com>, Stefan Agner <stefan@agner.ch>,\n\tlinux-mtd@lists.infradead.org, Miquel Raynal <miquel.raynal@bootlin.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"Prepare the migration to nand_scan() by moving both calls to\nnand_scan_ident() and nand_scan_tail() in a single spot.\n\nSigned-off-by: Miquel Raynal <miquel.raynal@bootlin.com>\n---\n drivers/mtd/nand/raw/jz4740_nand.c | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)","diff":"diff --git a/drivers/mtd/nand/raw/jz4740_nand.c b/drivers/mtd/nand/raw/jz4740_nand.c\nindex 3abf87420c10..09541608a45f 100644\n--- a/drivers/mtd/nand/raw/jz4740_nand.c\n+++ b/drivers/mtd/nand/raw/jz4740_nand.c\n@@ -309,6 +309,7 @@ static int jz_nand_detect_bank(struct platform_device *pdev,\n \t\t\t       size_t chipnr, uint8_t *nand_maf_id,\n \t\t\t       uint8_t *nand_dev_id)\n {\n+\tstruct jz_nand_platform_data *pdata = dev_get_platdata(&pdev->dev);\n \tint ret;\n \tchar res_name[6];\n \tuint32_t ctrl;\n@@ -335,8 +336,19 @@ static int jz_nand_detect_bank(struct platform_device *pdev,\n \t\tif (ret)\n \t\t\tgoto notfound_id;\n \n+\t\tif (pdata && pdata->ident_callback)\n+\t\t\tpdata->ident_callback(pdev, mtd, &pdata->partitions,\n+\t\t\t\t\t      &pdata->num_partitions);\n+\n+\t\tret = nand_scan_tail(mtd);\n+\t\tif (ret) {\n+\t\t\tdev_err(&pdev->dev,  \"Failed to scan NAND\\n\");\n+\t\t\tgoto notfound_id;\n+\t\t}\n+\n \t\t/* Retrieve the IDs from the first chip. */\n \t\tchip->select_chip(mtd, 0);\n+\n \t\tnand_reset_op(chip);\n \t\tnand_readid_op(chip, 0, id, sizeof(id));\n \t\t*nand_maf_id = id[0];\n@@ -456,17 +468,6 @@ static int jz_nand_probe(struct platform_device *pdev)\n \t\tgoto err_iounmap_mmio;\n \t}\n \n-\tif (pdata && pdata->ident_callback) {\n-\t\tpdata->ident_callback(pdev, mtd, &pdata->partitions,\n-\t\t\t\t\t&pdata->num_partitions);\n-\t}\n-\n-\tret = nand_scan_tail(mtd);\n-\tif (ret) {\n-\t\tdev_err(&pdev->dev,  \"Failed to scan NAND\\n\");\n-\t\tgoto err_unclaim_banks;\n-\t}\n-\n \tret = mtd_device_register(mtd, pdata ? pdata->partitions : NULL,\n \t\t\t\t  pdata ? pdata->num_partitions : 0);\n \n@@ -481,7 +482,6 @@ static int jz_nand_probe(struct platform_device *pdev)\n \n err_cleanup_nand:\n \tnand_cleanup(chip);\n-err_unclaim_banks:\n \twhile (chipnr--) {\n \t\tunsigned char bank = nand->banks[chipnr];\n \t\tjz_nand_iounmap_resource(nand->bank_mem[bank - 1],\n","prefixes":["v5","10/17"]}