linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: remove unused ->init_size() hook
@ 2015-10-01 14:58 Boris Brezillon
  2015-10-01 17:21 ` Brian Norris
  0 siblings, 1 reply; 2+ messages in thread
From: Boris Brezillon @ 2015-10-01 14:58 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, linux-mtd
  Cc: linux-kernel, Huang Shijie, Boris Brezillon

The ->init_size() hook was introduced to let NAND controller drivers
support NAND devices that could not be described in the nand_ids table.
Since then, the core has added support for extended-id parsing and
full-id description, thus allowing to describe pretty much all existing
NANDs.
Moreover, this hook is not used by any mainline driver, and should not be
used by new drivers, because detecting the NAND chip is not something
controller specific.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
 drivers/mtd/nand/nand_base.c | 5 +----
 include/linux/mtd/nand.h     | 6 ------
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 37c0d9d..a8230b1 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3836,10 +3836,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
 
 	chip->chipsize = (uint64_t)type->chipsize << 20;
 
-	if (!type->pagesize && chip->init_size) {
-		/* Set the pagesize, oobsize, erasesize by the driver */
-		busw = chip->init_size(mtd, chip, id_data);
-	} else if (!type->pagesize) {
+	if (!type->pagesize) {
 		/* Decode parameters from extended ID */
 		nand_decode_ext_id(mtd, chip, id_data, &busw);
 	} else {
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index c4d8e30..50e1f94 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -556,10 +556,6 @@ struct nand_buffers {
  * @block_markbad:	[REPLACEABLE] mark a block bad
  * @cmd_ctrl:		[BOARDSPECIFIC] hardwarespecific function for controlling
  *			ALE/CLE/nCE. Also used to write command and address
- * @init_size:		[BOARDSPECIFIC] hardwarespecific function for setting
- *			mtd->oobsize, mtd->writesize and so on.
- *			@id_data contains the 8 bytes values of NAND_CMD_READID.
- *			Return with the bus width.
  * @dev_ready:		[BOARDSPECIFIC] hardwarespecific function for accessing
  *			device ready/busy line. If set to NULL no access to
  *			ready/busy is available and the ready/busy information
@@ -658,8 +654,6 @@ struct nand_chip {
 	int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
 	int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
 	void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl);
-	int (*init_size)(struct mtd_info *mtd, struct nand_chip *this,
-			u8 *id_data);
 	int (*dev_ready)(struct mtd_info *mtd);
 	void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column,
 			int page_addr);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: nand: remove unused ->init_size() hook
  2015-10-01 14:58 [PATCH] mtd: nand: remove unused ->init_size() hook Boris Brezillon
@ 2015-10-01 17:21 ` Brian Norris
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Norris @ 2015-10-01 17:21 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: David Woodhouse, linux-mtd, linux-kernel, Huang Shijie

On Thu, Oct 01, 2015 at 04:58:27PM +0200, Boris Brezillon wrote:
> The ->init_size() hook was introduced to let NAND controller drivers
> support NAND devices that could not be described in the nand_ids table.
> Since then, the core has added support for extended-id parsing and
> full-id description, thus allowing to describe pretty much all existing
> NANDs.
> Moreover, this hook is not used by any mainline driver, and should not be
> used by new drivers, because detecting the NAND chip is not something
> controller specific.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Looks obvious and passes all my builds. Pushed to l2-mtd.git.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-01 17:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-01 14:58 [PATCH] mtd: nand: remove unused ->init_size() hook Boris Brezillon
2015-10-01 17:21 ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).