]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mtd: rawnand: Inline onfi_get_async_timing_mode()
authorBoris Brezillon <boris.brezillon@bootlin.com>
Thu, 6 Sep 2018 22:38:47 +0000 (00:38 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 3 Oct 2018 09:12:25 +0000 (11:12 +0200)
onfi_get_async_timing_mode() is only used in one place inside
nand_base.c. Let's inline the code and kill the helper.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/nand_base.c
include/linux/mtd/rawnand.h

index 2f8bbc3bca7a880e04c8ca99361c831f10c395e3..136ccdc61a06181fa0fa16bfa773d5138b382971 100644 (file)
@@ -1310,8 +1310,9 @@ static int nand_init_data_interface(struct nand_chip *chip)
         * if the NAND does not support ONFI, fallback to the default ONFI
         * timing mode.
         */
-       modes = onfi_get_async_timing_mode(chip);
-       if (modes == ONFI_TIMING_MODE_UNKNOWN) {
+       if (chip->parameters.onfi) {
+               modes = chip->parameters.onfi->async_timing_mode;
+       } else {
                if (!chip->onfi_timing_mode_default)
                        return 0;
 
index 04e11a314e9caa27140114ca3e3f84fc6044319a..7f0e3dc222ed833eb2e9b6fd7697cb5c6434e51b 100644 (file)
@@ -1540,15 +1540,6 @@ 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,
                    int allowbbt);
 
-/* return the supported asynchronous timing mode. */
-static inline int onfi_get_async_timing_mode(struct nand_chip *chip)
-{
-       if (!chip->parameters.onfi)
-               return ONFI_TIMING_MODE_UNKNOWN;
-
-       return chip->parameters.onfi->async_timing_mode;
-}
-
 int onfi_fill_data_interface(struct nand_chip *chip,
                             enum nand_data_interface_type type,
                             int timing_mode);