summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-09-07 00:38:38 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2018-10-03 11:12:25 +0200
commitcdc784c743945f445a26f4c0bd60a50a1adb39c4 (patch)
treeb6c4e0a93733d299c229a9e40e4897c655606ac8 /include/linux/mtd
parent8395b753d7cad2beb03d374621cc8851f1cb4e01 (diff)
downloadlinux-cdc784c743945f445a26f4c0bd60a50a1adb39c4.tar.gz
linux-cdc784c743945f445a26f4c0bd60a50a1adb39c4.tar.bz2
linux-cdc784c743945f445a26f4c0bd60a50a1adb39c4.zip
mtd: rawnand: Deprecate ->block_{bad,markbad}() hooks
Those hooks have been overloaded by some drivers for bad reasons: either the driver was not fitting in the NAND framework and should have been an MTD driver (docg4), or it was not properly implementing the OOB read/write request or had a weird layout where BBM are trashed. In any case, we should discourage people from overloading those methods and encourage them to fix their driver instead. Move the ->block_{bad,markbad}() hooks to the nand_legacy struct to make it clear. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/rawnand.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 15642c028da2..aa3e931d0206 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -1187,6 +1187,8 @@ int nand_op_parser_exec_op(struct nand_chip *chip,
* If set to NULL no access to ready/busy is available and the
* ready/busy information is read from the chip status register.
* @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
*
* If you look at this structure you're already wrong. These fields/hooks are
* all deprecated.
@@ -1203,6 +1205,8 @@ struct nand_legacy {
int page_addr);
int (*dev_ready)(struct nand_chip *chip);
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);
};
/**
@@ -1214,8 +1218,6 @@ struct nand_legacy {
* fields/hooks, you should consider reworking the driver
* avoid using them.
* @select_chip: [REPLACEABLE] select chip nr
- * @block_bad: [REPLACEABLE] check if a block is bad, using OOB markers
- * @block_markbad: [REPLACEABLE] mark a block bad
* @exec_op: controller specific method to execute NAND operations.
* This method replaces ->cmdfunc(),
* ->legacy.{read,write}_{buf,byte,word}(),
@@ -1303,8 +1305,6 @@ struct nand_chip {
struct nand_legacy legacy;
void (*select_chip)(struct nand_chip *chip, int cs);
- int (*block_bad)(struct nand_chip *chip, loff_t ofs);
- int (*block_markbad)(struct nand_chip *chip, loff_t ofs);
int (*exec_op)(struct nand_chip *chip,
const struct nand_operation *op,
bool check_only);
@@ -1556,6 +1556,7 @@ extern const struct nand_manufacturer_ops macronix_nand_manuf_ops;
int nand_create_bbt(struct nand_chip *chip);
int nand_markbad_bbt(struct nand_chip *chip, loff_t offs);
+int nand_markbad_bbm(struct nand_chip *chip, loff_t ofs);
int nand_isreserved_bbt(struct nand_chip *chip, loff_t offs);
int nand_isbad_bbt(struct nand_chip *chip, loff_t offs, int allowbbt);
int nand_erase_nand(struct nand_chip *chip, struct erase_info *instr,