Commit e80eba75 authored by Boris Brezillon's avatar Boris Brezillon Committed by Miquel Raynal

mtd: rawnand: Kill the chip->scan_bbt() hook

None of the existing drivers are overloading the ->scan_bbt() method,
let's get rid of it and replace calls to ->scan_bbt() by
nand_create_bbt() ones.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 44b07b92
...@@ -1291,7 +1291,7 @@ static int __init nftl_scan_bbt(struct mtd_info *mtd) ...@@ -1291,7 +1291,7 @@ static int __init nftl_scan_bbt(struct mtd_info *mtd)
this->bbt_md = NULL; this->bbt_md = NULL;
} }
ret = this->scan_bbt(mtd); ret = nand_create_bbt(this);
if (ret) if (ret)
return ret; return ret;
...@@ -1338,7 +1338,7 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd) ...@@ -1338,7 +1338,7 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd)
this->bbt_md->pattern = "TBB_SYSM"; this->bbt_md->pattern = "TBB_SYSM";
} }
ret = this->scan_bbt(mtd); ret = nand_create_bbt(this);
if (ret) if (ret)
return ret; return ret;
......
...@@ -1944,7 +1944,7 @@ static int gpmi_nand_init(struct gpmi_nand_data *this) ...@@ -1944,7 +1944,7 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
ret = nand_boot_init(this); ret = nand_boot_init(this);
if (ret) if (ret)
goto err_nand_cleanup; goto err_nand_cleanup;
ret = chip->scan_bbt(mtd); ret = nand_create_bbt(chip);
if (ret) if (ret)
goto err_nand_cleanup; goto err_nand_cleanup;
......
...@@ -4924,11 +4924,6 @@ static void nand_shutdown(struct mtd_info *mtd) ...@@ -4924,11 +4924,6 @@ static void nand_shutdown(struct mtd_info *mtd)
nand_get_device(mtd, FL_PM_SUSPENDED); nand_get_device(mtd, FL_PM_SUSPENDED);
} }
static int nand_default_bbt(struct mtd_info *mtd)
{
return nand_create_bbt(mtd_to_nand(mtd));
}
/* Set default functions */ /* Set default functions */
static void nand_set_defaults(struct nand_chip *chip) static void nand_set_defaults(struct nand_chip *chip)
{ {
...@@ -4970,8 +4965,6 @@ static void nand_set_defaults(struct nand_chip *chip) ...@@ -4970,8 +4965,6 @@ static void nand_set_defaults(struct nand_chip *chip)
chip->write_byte = busw ? nand_write_byte16 : nand_write_byte; chip->write_byte = busw ? nand_write_byte16 : nand_write_byte;
if (!chip->read_buf || chip->read_buf == nand_read_buf) if (!chip->read_buf || chip->read_buf == nand_read_buf)
chip->read_buf = busw ? nand_read_buf16 : nand_read_buf; chip->read_buf = busw ? nand_read_buf16 : nand_read_buf;
if (!chip->scan_bbt)
chip->scan_bbt = nand_default_bbt;
if (!chip->controller) { if (!chip->controller) {
chip->controller = &chip->hwcontrol; chip->controller = &chip->hwcontrol;
...@@ -6673,7 +6666,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -6673,7 +6666,7 @@ int nand_scan_tail(struct mtd_info *mtd)
return 0; return 0;
/* Build bad block table */ /* Build bad block table */
ret = chip->scan_bbt(mtd); ret = nand_create_bbt(chip);
if (ret) if (ret)
goto err_nand_manuf_cleanup; goto err_nand_manuf_cleanup;
......
...@@ -2337,7 +2337,7 @@ static int __init ns_init_module(void) ...@@ -2337,7 +2337,7 @@ static int __init ns_init_module(void)
if ((retval = init_nandsim(nsmtd)) != 0) if ((retval = init_nandsim(nsmtd)) != 0)
goto err_exit; goto err_exit;
if ((retval = chip->scan_bbt(nsmtd)) != 0) if ((retval = nand_create_bbt(chip)) != 0)
goto err_exit; goto err_exit;
if ((retval = parse_badblocks(nand, nsmtd)) != 0) if ((retval = parse_badblocks(nand, nsmtd)) != 0)
......
...@@ -1199,7 +1199,6 @@ int nand_op_parser_exec_op(struct nand_chip *chip, ...@@ -1199,7 +1199,6 @@ int nand_op_parser_exec_op(struct nand_chip *chip,
* @buf_align: minimum buffer alignment required by a platform * @buf_align: minimum buffer alignment required by a platform
* @hwcontrol: platform-specific hardware control structure * @hwcontrol: platform-specific hardware control structure
* @erase: [REPLACEABLE] erase function * @erase: [REPLACEABLE] erase function
* @scan_bbt: [REPLACEABLE] function to scan bad block table
* @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring
* data from array to read regs (tR). * data from array to read regs (tR).
* @state: [INTERN] the current state of the NAND device * @state: [INTERN] the current state of the NAND device
...@@ -1292,7 +1291,6 @@ struct nand_chip { ...@@ -1292,7 +1291,6 @@ struct nand_chip {
const struct nand_operation *op, const struct nand_operation *op,
bool check_only); bool check_only);
int (*erase)(struct mtd_info *mtd, int page); int (*erase)(struct mtd_info *mtd, int page);
int (*scan_bbt)(struct mtd_info *mtd);
int (*set_features)(struct mtd_info *mtd, struct nand_chip *chip, int (*set_features)(struct mtd_info *mtd, struct nand_chip *chip,
int feature_addr, uint8_t *subfeature_para); int feature_addr, uint8_t *subfeature_para);
int (*get_features)(struct mtd_info *mtd, struct nand_chip *chip, int (*get_features)(struct mtd_info *mtd, struct nand_chip *chip,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment