]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mtd: rawnand: Get rid of the ->read_word() hook
authorBoris Brezillon <boris.brezillon@bootlin.com>
Fri, 27 Jul 2018 21:05:42 +0000 (23:05 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 4 Sep 2018 20:53:13 +0000 (22:53 +0200)
Commit c120e75e0e7d ("mtd: nand: use read_oob() instead of cmdfunc()
for bad block check") removed this only user of the ->read_word()
method but kept the hook in place. Remove it now.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/atmel/nand-controller.c
drivers/mtd/nand/raw/au1550nd.c
drivers/mtd/nand/raw/denali.c
drivers/mtd/nand/raw/hisi504_nand.c
drivers/mtd/nand/raw/mpc5121_nfc.c
drivers/mtd/nand/raw/mxc_nand.c
drivers/mtd/nand/raw/nand_base.c
drivers/mtd/nand/raw/nandsim.c
drivers/mtd/nand/raw/sh_flctl.c
drivers/mtd/nand/raw/socrates_nand.c
include/linux/mtd/rawnand.h

index a068b214ebaa7970fac10d1b0ae4b2af0602e9ae..525e1325841d25a190ecd2d0d7f894c9c1894d45 100644 (file)
@@ -418,14 +418,6 @@ static u8 atmel_nand_read_byte(struct mtd_info *mtd)
        return ioread8(nand->activecs->io.virt);
 }
 
-static u16 atmel_nand_read_word(struct mtd_info *mtd)
-{
-       struct nand_chip *chip = mtd_to_nand(mtd);
-       struct atmel_nand *nand = to_atmel_nand(chip);
-
-       return ioread16(nand->activecs->io.virt);
-}
-
 static void atmel_nand_write_byte(struct mtd_info *mtd, u8 byte)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
@@ -1500,7 +1492,6 @@ static void atmel_nand_init(struct atmel_nand_controller *nc,
 
        chip->cmd_ctrl = atmel_nand_cmd_ctrl;
        chip->read_byte = atmel_nand_read_byte;
-       chip->read_word = atmel_nand_read_word;
        chip->write_byte = atmel_nand_write_byte;
        chip->read_buf = atmel_nand_read_buf;
        chip->write_buf = atmel_nand_write_buf;
index 35f5c84cd33162e4a290ce96795c4dc4a8d40d11..32c0440141fb608cf30bb4c8c61c1a21183750bb 100644 (file)
@@ -83,20 +83,6 @@ static void au_write_byte16(struct mtd_info *mtd, u_char byte)
        wmb(); /* drain writebuffer */
 }
 
-/**
- * au_read_word -  read one word from the chip
- * @mtd:       MTD device structure
- *
- * read function for 16bit buswidth without endianness conversion
- */
-static u16 au_read_word(struct mtd_info *mtd)
-{
-       struct nand_chip *this = mtd_to_nand(mtd);
-       u16 ret = readw(this->IO_ADDR_R);
-       wmb(); /* drain writebuffer */
-       return ret;
-}
-
 /**
  * au_write_buf -  write buffer to chip
  * @mtd:       MTD device structure
@@ -462,7 +448,6 @@ static int au1550nd_probe(struct platform_device *pdev)
 
        this->read_byte = (pd->devwidth) ? au_read_byte16 : au_read_byte;
        ctx->write_byte = (pd->devwidth) ? au_write_byte16 : au_write_byte;
-       this->read_word = au_read_word;
        this->write_buf = (pd->devwidth) ? au_write_buf16 : au_write_buf;
        this->read_buf = (pd->devwidth) ? au_read_buf16 : au_read_buf;
 
index 67b2065e7a19cace554463a74871ab676c221906..5ff2ca1638848b284476e99915e2575d6a452141 100644 (file)
@@ -279,15 +279,6 @@ static void denali_write_byte(struct mtd_info *mtd, uint8_t byte)
        denali_write_buf(mtd, &byte, 1);
 }
 
-static uint16_t denali_read_word(struct mtd_info *mtd)
-{
-       uint16_t word;
-
-       denali_read_buf16(mtd, (uint8_t *)&word, 2);
-
-       return word;
-}
-
 static void denali_cmd_ctrl(struct mtd_info *mtd, int dat, unsigned int ctrl)
 {
        struct denali_nand_info *denali = mtd_to_denali(mtd);
@@ -1354,7 +1345,6 @@ int denali_init(struct denali_nand_info *denali)
        chip->select_chip = denali_select_chip;
        chip->read_byte = denali_read_byte;
        chip->write_byte = denali_write_byte;
-       chip->read_word = denali_read_word;
        chip->cmd_ctrl = denali_cmd_ctrl;
        chip->dev_ready = denali_dev_ready;
        chip->waitfunc = denali_waitfunc;
index 950dc7789296fa3d30c3c63adadfa474594f773f..0f5c48aa5673435939f73c82d7e58fd66576a984 100644 (file)
@@ -380,15 +380,6 @@ static uint8_t hisi_nfc_read_byte(struct mtd_info *mtd)
        return *(uint8_t *)(host->buffer + host->offset - 1);
 }
 
-static u16 hisi_nfc_read_word(struct mtd_info *mtd)
-{
-       struct nand_chip *chip = mtd_to_nand(mtd);
-       struct hinfc_host *host = nand_get_controller_data(chip);
-
-       host->offset += 2;
-       return *(u16 *)(host->buffer + host->offset - 2);
-}
-
 static void
 hisi_nfc_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
 {
@@ -795,7 +786,6 @@ static int hisi_nfc_probe(struct platform_device *pdev)
        chip->cmdfunc           = hisi_nfc_cmdfunc;
        chip->select_chip       = hisi_nfc_select_chip;
        chip->read_byte         = hisi_nfc_read_byte;
-       chip->read_word         = hisi_nfc_read_word;
        chip->write_buf         = hisi_nfc_write_buf;
        chip->read_buf          = hisi_nfc_read_buf;
        chip->chip_delay        = HINFC504_CHIP_DELAY;
index 6d1740d54e0de7e9794de892ed1afb61120bddab..c0be9c30b4cfb3b786e0c9645323162c4319924f 100644 (file)
@@ -515,16 +515,6 @@ static u8 mpc5121_nfc_read_byte(struct mtd_info *mtd)
        return tmp;
 }
 
-/* Read word from NFC buffers */
-static u16 mpc5121_nfc_read_word(struct mtd_info *mtd)
-{
-       u16 tmp;
-
-       mpc5121_nfc_read_buf(mtd, (u_char *)&tmp, sizeof(tmp));
-
-       return tmp;
-}
-
 /*
  * Read NFC configuration from Reset Config Word
  *
@@ -703,7 +693,6 @@ static int mpc5121_nfc_probe(struct platform_device *op)
        chip->dev_ready = mpc5121_nfc_dev_ready;
        chip->cmdfunc = mpc5121_nfc_command;
        chip->read_byte = mpc5121_nfc_read_byte;
-       chip->read_word = mpc5121_nfc_read_word;
        chip->read_buf = mpc5121_nfc_read_buf;
        chip->write_buf = mpc5121_nfc_write_buf;
        chip->select_chip = mpc5121_nfc_select_chip;
index 4c9214dea4240b7057df964034ea59d5bca892ac..a0884a621053f562aedfe171bd7d85c84befd8cd 100644 (file)
@@ -921,18 +921,6 @@ static u_char mxc_nand_read_byte(struct mtd_info *mtd)
        return ret;
 }
 
-static uint16_t mxc_nand_read_word(struct mtd_info *mtd)
-{
-       struct nand_chip *nand_chip = mtd_to_nand(mtd);
-       struct mxc_nand_host *host = nand_get_controller_data(nand_chip);
-       uint16_t ret;
-
-       ret = *(uint16_t *)(host->data_buf + host->buf_start);
-       host->buf_start += 2;
-
-       return ret;
-}
-
 /* Write data of length len to buffer buf. The data to be
  * written on NAND Flash is first copied to RAMbuffer. After the Data Input
  * Operation by the NFC, the data is written to NAND Flash */
@@ -1793,7 +1781,6 @@ static int mxcnd_probe(struct platform_device *pdev)
        this->dev_ready = mxc_nand_dev_ready;
        this->cmdfunc = mxc_nand_command;
        this->read_byte = mxc_nand_read_byte;
-       this->read_word = mxc_nand_read_word;
        this->write_buf = mxc_nand_write_buf;
        this->read_buf = mxc_nand_read_buf;
        this->set_features = mxc_nand_set_features;
index e591410cddc9d2ec9594865391b51464a5a17d6a..306ef6ec41db66103f30b4e97d3e7750ee69d4c2 100644 (file)
@@ -277,18 +277,6 @@ static uint8_t nand_read_byte16(struct mtd_info *mtd)
        return (uint8_t) cpu_to_le16(readw(chip->IO_ADDR_R));
 }
 
-/**
- * nand_read_word - [DEFAULT] read one word from the chip
- * @mtd: MTD device structure
- *
- * Default read function for 16bit buswidth without endianness conversion.
- */
-static u16 nand_read_word(struct mtd_info *mtd)
-{
-       struct nand_chip *chip = mtd_to_nand(mtd);
-       return readw(chip->IO_ADDR_R);
-}
-
 /**
  * nand_select_chip - [DEFAULT] control CE line
  * @mtd: MTD device structure
@@ -5007,8 +4995,6 @@ static void nand_set_defaults(struct nand_chip *chip)
        /* If called twice, pointers that depend on busw may need to be reset */
        if (!chip->read_byte || chip->read_byte == nand_read_byte)
                chip->read_byte = busw ? nand_read_byte16 : nand_read_byte;
-       if (!chip->read_word)
-               chip->read_word = nand_read_word;
        if (!chip->block_bad)
                chip->block_bad = nand_block_bad;
        if (!chip->block_markbad)
index 71ac034aee9c2fbfc5d06686f66f6db4a7f6b766..47a81d1b1397ee8ddc2c08b91c019556b87c41fc 100644 (file)
@@ -2108,15 +2108,6 @@ static int ns_device_ready(struct mtd_info *mtd)
        return 1;
 }
 
-static uint16_t ns_nand_read_word(struct mtd_info *mtd)
-{
-       struct nand_chip *chip = mtd_to_nand(mtd);
-
-       NS_DBG("read_word\n");
-
-       return chip->read_byte(mtd) | (chip->read_byte(mtd) << 8);
-}
-
 static void ns_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
 {
        struct nand_chip *chip = mtd_to_nand(mtd);
@@ -2267,7 +2258,6 @@ static int __init ns_init_module(void)
        chip->dev_ready  = ns_device_ready;
        chip->write_buf  = ns_nand_write_buf;
        chip->read_buf   = ns_nand_read_buf;
-       chip->read_word  = ns_nand_read_word;
        chip->ecc.mode   = NAND_ECC_SOFT;
        chip->ecc.algo   = NAND_ECC_HAMMING;
        /* The NAND_SKIP_BBTSCAN option is necessary for 'overridesize' */
index bb8866e05ff76cc2be9bb1d24f2f5eaadb3799bc..ef3036d9bf156bdde0dc65b837e4738088ac9cbb 100644 (file)
@@ -985,15 +985,6 @@ static uint8_t flctl_read_byte(struct mtd_info *mtd)
        return data;
 }
 
-static uint16_t flctl_read_word(struct mtd_info *mtd)
-{
-       struct sh_flctl *flctl = mtd_to_flctl(mtd);
-       uint16_t *buf = (uint16_t *)&flctl->done_buff[flctl->index];
-
-       flctl->index += 2;
-       return *buf;
-}
-
 static void flctl_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
 {
        struct sh_flctl *flctl = mtd_to_flctl(mtd);
@@ -1186,7 +1177,6 @@ static int flctl_probe(struct platform_device *pdev)
        nand->chip_delay = 20;
 
        nand->read_byte = flctl_read_byte;
-       nand->read_word = flctl_read_word;
        nand->write_buf = flctl_write_buf;
        nand->read_buf = flctl_read_buf;
        nand->select_chip = flctl_select_chip;
index 9824a9923583c453906ae499e18992b8fd096904..36c45aa21f663a6f7ad9836b53720409ed344e8d 100644 (file)
@@ -85,17 +85,6 @@ static uint8_t socrates_nand_read_byte(struct mtd_info *mtd)
        return byte;
 }
 
-/**
- * socrates_nand_read_word -  read one word from the chip
- * @mtd:       MTD device structure
- */
-static uint16_t socrates_nand_read_word(struct mtd_info *mtd)
-{
-       uint16_t word;
-       socrates_nand_read_buf(mtd, (uint8_t *)&word, sizeof(word));
-       return word;
-}
-
 /*
  * Hardware specific access to control-lines
  */
@@ -172,7 +161,6 @@ static int socrates_nand_probe(struct platform_device *ofdev)
 
        nand_chip->cmd_ctrl = socrates_nand_cmd_ctrl;
        nand_chip->read_byte = socrates_nand_read_byte;
-       nand_chip->read_word = socrates_nand_read_word;
        nand_chip->write_buf = socrates_nand_write_buf;
        nand_chip->read_buf = socrates_nand_read_buf;
        nand_chip->dev_ready = socrates_nand_device_ready;
index efb2345359bbd8e09765491f1bb126803c6f2fb4..d155470f53c8a5c78ec0c370c60db583cf006baa 100644 (file)
@@ -1182,7 +1182,6 @@ int nand_op_parser_exec_op(struct nand_chip *chip,
  * @IO_ADDR_W:         [BOARDSPECIFIC] address to write the 8 I/O lines of the
  *                     flash device.
  * @read_byte:         [REPLACEABLE] read one byte from the chip
- * @read_word:         [REPLACEABLE] read one word from the chip
  * @write_byte:                [REPLACEABLE] write a single byte to the chip on the
  *                     low 8 I/O lines
  * @write_buf:         [REPLACEABLE] write data from the buffer to the chip
@@ -1287,7 +1286,6 @@ struct nand_chip {
        void __iomem *IO_ADDR_W;
 
        uint8_t (*read_byte)(struct mtd_info *mtd);
-       u16 (*read_word)(struct mtd_info *mtd);
        void (*write_byte)(struct mtd_info *mtd, uint8_t byte);
        void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
        void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);