Message ID | 1487593718-20752-4-git-send-email-boris.brezillon@free-electrons.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Boris, 2017-02-20 21:28 GMT+09:00 Boris Brezillon <boris.brezillon@free-electrons.com>: > The last/only user of the chip->write_page() hook (the Atmel NAND > controller driver) has been reworked and is no longer specifying a custom > ->write_page() implementation. > Drop this hook before someone else start abusing it. > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Just a minor comment. /** * nand_write_page - [REPLACEABLE] write one page * @mtd: MTD device structure Can you update the comment block for nand_write_page(), too? [REPLACEABLE] -> [INTERNAL]
On Tue, 7 Mar 2017 21:04:50 +0900 Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > Hi Boris, > > 2017-02-20 21:28 GMT+09:00 Boris Brezillon <boris.brezillon@free-electrons.com>: > > The last/only user of the chip->write_page() hook (the Atmel NAND > > controller driver) has been reworked and is no longer specifying a custom > > ->write_page() implementation. > > Drop this hook before someone else start abusing it. > > > > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> > > > Just a minor comment. > > > /** > * nand_write_page - [REPLACEABLE] write one page > * @mtd: MTD device structure > > > Can you update the comment block for nand_write_page(), too? > > [REPLACEABLE] -> [INTERNAL] I think I'll just drop it, it does not mean anything to flag a static function as replaceable (the ->write_page() method could be overloaded, but not the nand_write_page() implementation itself).
2017-03-08 3:34 GMT+09:00 Boris Brezillon <boris.brezillon@free-electrons.com>: > On Tue, 7 Mar 2017 21:04:50 +0900 > Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > >> Hi Boris, >> >> 2017-02-20 21:28 GMT+09:00 Boris Brezillon <boris.brezillon@free-electrons.com>: >> > The last/only user of the chip->write_page() hook (the Atmel NAND >> > controller driver) has been reworked and is no longer specifying a custom >> > ->write_page() implementation. >> > Drop this hook before someone else start abusing it. >> > >> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> >> >> >> Just a minor comment. >> >> >> /** >> * nand_write_page - [REPLACEABLE] write one page >> * @mtd: MTD device structure >> >> >> Can you update the comment block for nand_write_page(), too? >> >> [REPLACEABLE] -> [INTERNAL] > > I think I'll just drop it, it does not mean anything to flag a static > function as replaceable (the ->write_page() method could be overloaded, > but not the nand_write_page() implementation itself). > Sounds good to me. Thank you!
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index ec1c28aaaf23..c8894f31392e 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2839,9 +2839,10 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to, /* We still need to erase leftover OOB data */ memset(chip->oob_poi, 0xff, mtd->oobsize); } - ret = chip->write_page(mtd, chip, column, bytes, wbuf, - oob_required, page, cached, - (ops->mode == MTD_OPS_RAW)); + + ret = nand_write_page(mtd, chip, column, bytes, wbuf, + oob_required, page, cached, + (ops->mode == MTD_OPS_RAW)); if (ret) break; @@ -4623,9 +4624,6 @@ int nand_scan_tail(struct mtd_info *mtd) } } - if (!chip->write_page) - chip->write_page = nand_write_page; - /* * Check ECC mode, default to software if 3byte/512byte hardware ECC is * selected and we have 256 byte pagesize fallback to software ECC diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index c5f3a012ae62..9d51dee53be4 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -818,7 +818,6 @@ nand_get_sdr_timings(const struct nand_data_interface *conf) * @errstat: [OPTIONAL] hardware specific function to perform * additional error status checks (determine if errors are * correctable). - * @write_page: [REPLACEABLE] High-level page write function */ struct nand_chip { @@ -843,9 +842,6 @@ struct nand_chip { int (*scan_bbt)(struct mtd_info *mtd); int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); - int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, - uint32_t offset, int data_len, const uint8_t *buf, - int oob_required, int page, int cached, int raw); int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip, int feature_addr, uint8_t *subfeature_para); int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip,
The last/only user of the chip->write_page() hook (the Atmel NAND controller driver) has been reworked and is no longer specifying a custom ->write_page() implementation. Drop this hook before someone else start abusing it. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> --- drivers/mtd/nand/nand_base.c | 10 ++++------ include/linux/mtd/nand.h | 4 ---- 2 files changed, 4 insertions(+), 10 deletions(-)