From patchwork Mon Jan 21 06:24:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 156149 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6025002jaa; Sun, 20 Jan 2019 22:25:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN7MQWEFQt7AnmStY0ZFbhW19+qHfIsC2YXZ4UvNkK000PT9vXvsHmpdVrcwr8DEGc6RRyQb X-Received: by 2002:a62:c42:: with SMTP id u63mr28132513pfi.73.1548051930502; Sun, 20 Jan 2019 22:25:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548051930; cv=none; d=google.com; s=arc-20160816; b=A9a23TsulSaQTvwth7DP9y+PGx3PPkSTLOSmcrlybQ83zCu3v9Qlig0It2L8S7x4rP gd1bPj6hbZZLK8N5+WkAk0Ex7T4GV5lCT9VtX9CbW+jeaKsEKkMGqv7jkU1BsXcp9PUz Dqk2bRfAek63riyq2alK2+OrOHI9mY0oE2hFnOZJQhnC3r0cCAuzMt4yEemQNWqaX5G1 qHdkI6Sp/eqISzokZqDTRhMkhK3X/nkBAY2+m4ZkBSOESvmSZTjJ4ILsjxn82ZHIQLqf v9IYF9stzHvYgy+qCcKO3Ubt1h+YrrWdF84MvSzcIPICnhD1PT3Hje/1KW/2tR2ZNJgQ 1zqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :dkim-filter:dkim-signature; bh=EtCQlBvzeywXRhQKzadurHSNprgoUgue+mLZ/bpQqoQ=; b=bSSmUNRbtqgxFr2v5ZEO5jrGwD6OOnNG7tvpF+LoPIYvgYnuR2IfVi1+WUWj0WI4VD leCOdDO6Nkj60f6vr+WsnVbMYBabXgOUZ25F8THOvzG9iWyRS5sv1x2Ddj49WJd8mXxq z7+EiEqeU6GU2Tv0oiRS+ooPlTPIRrHvqglPpev78G6NgpEkB1YKthbxBUyNgqb6c3+P nsIQeSACVzML3WRpnv+U/CHLssvuc4mRBeAiv64swJbcrPRem3weSjGU2NkpDh5nimFT s33wWkzXjGWn8C5a1ibzj5hT/2/ZnQxIvYGabsF1xWOKBa8RGyhNLaOGir9RTn7pp8Gh OnUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=mpfOPUb1; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=pqr1ZMJQ; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id i63si12494174pge.515.2019.01.20.22.25.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jan 2019 22:25:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=mpfOPUb1; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=pqr1ZMJQ; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=EtCQlBvzeywXRhQKzadurHSNprgoUgue+mLZ/bpQqoQ=; b=mpf OPUb1ukpf3c6Dbi4lC5ZoGvIjkSAqYHtL1GMsLjrmMfy5ewPs0RVpImcSjKLgeNAjmpmQ/VXx9oZu fqbFvoGEhtog6bATJyYwF97BO6quz+OjyF4Vff2KXpZD3z0kK0aGlO/HCnxRptJ2vlJD/FREpBdnR uI3ZHL4viPm/i8YjpteW8o2YTAB4Xs19N8kHj1qmOCIWuZ5GTGiEn8QVoHQMGpGcGtLC9AemaI9S4 plzLWoAkYisb+n/kFxxWPd6opZCBEfJgxuS4IF3pwoEwUYHNR7KSdyxrVe8I/jMutLRVDNUW+N4MJ xUsOyDXRmNuirR7sHZmSJ1UYSh78lVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1glT1L-0007Ey-EF; Mon, 21 Jan 2019 06:25:19 +0000 Received: from conuserg-08.nifty.com ([210.131.2.75]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1glT1I-0007EX-47 for linux-mtd@lists.infradead.org; Mon, 21 Jan 2019 06:25:18 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x0L6OouF008453; Mon, 21 Jan 2019 15:24:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x0L6OouF008453 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1548051891; bh=3LVT/OIOW3XpkTEn5pOcQFDy+pugI4n0eFXqWzDArxM=; h=From:To:Cc:Subject:Date:From; b=pqr1ZMJQPNp+jAzHuRd71HwbVpEvindzk6ns5XzeREQ4g6qcsNTOjJ8RgCQREdhgG 3/1iO8MBGfrxEnHJBsD6CHCa+IZdZt4HfAflVvBvGZk3lp3nPqGxBG+CfxEo3aFszf KjXHHa5Y6iEFxhQ/rQqPNjBISHBTaJEEZ2Odu+SHAnAsTSijxkUD5yjMDAnJti/J2U eqZX0m/EqiMk1k4nyQM2g6c80JW8FDK0Tz9ddouM91mwMVJTvJ0sV7HPawImNPmgfN VhXFypo5+GMVWW6bRVEG8mgEvkBHeNb03LKuExfCpMcni+0k1e9jkAdN8pULV0Qeyo zZxLdQ1zIRkCQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Boris Brezillon , Miquel Raynal Subject: [PATCH] mtd: rawnand: remove ->legacy.erase and single_erase() Date: Mon, 21 Jan 2019 15:24:43 +0900 Message-Id: <1548051883-8309-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190120_222516_508246_19A9E8AF X-CRM114-Status: GOOD ( 14.25 ) X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [210.131.2.75 listed in list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Richard Weinberger , Boris Brezillon , linux-kernel@vger.kernel.org, Masahiro Yamada , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Now that the last user of this hook, denali.c, stopped using it, we can remove the erase hook from nand_legacy. I squashed single_erase() because only the difference between single_erase() and nand_erase_op() is the number of bit shifts. The status/ret conversion in nand_erase_nand() is unneeded since commit eb94555e9e97 ("mtd: nand: use usual return values for the ->erase() hook"). Cleaned it up now. Signed-off-by: Masahiro Yamada --- This depends on the denali patch: http://patchwork.ozlabs.org/patch/1028264/ drivers/mtd/nand/raw/nand_base.c | 32 +++++--------------------------- include/linux/mtd/rawnand.h | 2 -- 2 files changed, 5 insertions(+), 29 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index cca4b24..690900b 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -4155,23 +4155,6 @@ static int nand_write_oob(struct mtd_info *mtd, loff_t to, } /** - * single_erase - [GENERIC] NAND standard block erase command function - * @chip: NAND chip object - * @page: the page address of the block which will be erased - * - * Standard erase command for NAND chips. Returns NAND status. - */ -static int single_erase(struct nand_chip *chip, int page) -{ - unsigned int eraseblock; - - /* Send commands to erase a block */ - eraseblock = page >> (chip->phys_erase_shift - chip->page_shift); - - return nand_erase_op(chip, eraseblock); -} - -/** * nand_erase - [MTD Interface] erase block(s) * @mtd: MTD device structure * @instr: erase instruction @@ -4194,7 +4177,7 @@ static int nand_erase(struct mtd_info *mtd, struct erase_info *instr) int nand_erase_nand(struct nand_chip *chip, struct erase_info *instr, int allowbbt) { - int page, status, pages_per_block, ret, chipnr; + int page, pages_per_block, ret, chipnr; loff_t len; pr_debug("%s: start = 0x%012llx, len = %llu\n", @@ -4246,17 +4229,12 @@ int nand_erase_nand(struct nand_chip *chip, struct erase_info *instr, (page + pages_per_block)) chip->pagebuf = -1; - if (chip->legacy.erase) - status = chip->legacy.erase(chip, - page & chip->pagemask); - else - status = single_erase(chip, page & chip->pagemask); - - /* See if block erase succeeded */ - if (status) { + ret = nand_erase_op(chip, + page >> (chip->phys_erase_shift - + chip->page_shift)); + if (ret) { pr_debug("%s: failed erase, page 0x%08x\n", __func__, page); - ret = -EIO; instr->fail_addr = ((loff_t)page << chip->page_shift); goto erase_exit; diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 33e240a..5e37534 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -936,7 +936,6 @@ static inline void nand_controller_init(struct nand_controller *nfc) * @waitfunc: hardware specific function for wait on ready. * @block_bad: check if a block is bad, using OOB markers * @block_markbad: mark a block bad - * @erase: erase function * @set_features: set the NAND chip features * @get_features: get the NAND chip features * @chip_delay: chip dependent delay for transferring data from array to read @@ -962,7 +961,6 @@ struct nand_legacy { int (*waitfunc)(struct nand_chip *chip); int (*block_bad)(struct nand_chip *chip, loff_t ofs); int (*block_markbad)(struct nand_chip *chip, loff_t ofs); - int (*erase)(struct nand_chip *chip, int page); int (*set_features)(struct nand_chip *chip, int feature_addr, u8 *subfeature_para); int (*get_features)(struct nand_chip *chip, int feature_addr,