flash/nand: review NAND driver interface
authorAntonio Borneo <borneo.antonio@gmail.com>
Fri, 31 Dec 2010 11:18:08 +0000 (19:18 +0800)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sun, 2 Jan 2011 18:49:36 +0000 (19:49 +0100)
From struct nand_flash_controller :
- remove unused field register_commands;
- remove field controller_ready, exported but
  never referenced.
Remove dead code pointed by controller_ready.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
13 files changed:
src/flash/nand/driver.h
src/flash/nand/lpc3180.c
src/flash/nand/mx2.c
src/flash/nand/mx3.c
src/flash/nand/nonce.c
src/flash/nand/orion.c
src/flash/nand/s3c2410.c
src/flash/nand/s3c2412.c
src/flash/nand/s3c2440.c
src/flash/nand/s3c2443.c
src/flash/nand/s3c24xx.c
src/flash/nand/s3c24xx.h
src/flash/nand/s3c6400.c

index deb41b2..4edce9f 100644 (file)
@@ -42,9 +42,6 @@ struct nand_flash_controller
        /** NAND device command called when driver is instantiated during configuration. */
        __NAND_DEVICE_COMMAND((*nand_device_command));
 
-       /** Register controller specific commands as a TCL interface to the driver. */
-       int (*register_commands)(struct command_context *cmd_ctx);
-
        /** Initialize the NAND device. */
        int (*init)(struct nand_device *nand);
 
@@ -75,9 +72,6 @@ struct nand_flash_controller
        /** Read a page from the NAND device. */
        int (*read_page)(struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size);
 
-       /** Check if the controller is ready for more instructions with timeout. */
-       int (*controller_ready)(struct nand_device *nand, int timeout);
-
        /** Check if the NAND device is ready for more instructions with timeout. */
        int (*nand_ready)(struct nand_device *nand, int timeout);
 };
index d81443d..3285c42 100644 (file)
@@ -1363,6 +1363,5 @@ struct nand_flash_controller lpc3180_nand_controller = {
        .read_data = lpc3180_read_data,
        .write_page = lpc3180_write_page,
        .read_page = lpc3180_read_page,
-       .controller_ready = lpc3180_controller_ready,
        .nand_ready = lpc3180_nand_ready,
 };
index 147546d..42bb072 100644 (file)
@@ -73,7 +73,6 @@ static int do_data_output(struct nand_device *nand);
 
 static int imx27_command(struct nand_device *nand, uint8_t command);
 static int imx27_address(struct nand_device *nand, uint8_t address);
-static int imx27_controller_ready(struct nand_device *nand, int tout);
 
 NAND_DEVICE_COMMAND_HANDLER(imx27_nand_device_command)
 {
@@ -229,11 +228,6 @@ static int imx27_write_data(struct nand_device *nand, uint16_t data)
        return ERROR_NAND_OPERATION_FAILED;
 }
 
-static int imx27_nand_ready(struct nand_device *nand, int timeout)
-{
-       return imx27_controller_ready(nand, timeout);
-}
-
 static int imx27_reset(struct nand_device *nand)
 {
        /*
@@ -342,7 +336,7 @@ static int imx27_address(struct nand_device *nand, uint8_t address)
        return ERROR_OK;
 }
 
-static int imx27_controller_ready(struct nand_device *nand, int tout)
+static int imx27_nand_ready(struct nand_device *nand, int tout)
 {
        uint16_t poll_complete_status;
        struct mx2_nf_controller *mx2_nf_info = nand->controller_priv;
@@ -771,6 +765,5 @@ struct nand_flash_controller imx27_nand_flash_controller = {
        .read_data              = &imx27_read_data,
        .write_page             = &imx27_write_page,
        .read_page              = &imx27_read_page,
-       .controller_ready       = &imx27_controller_ready,
        .nand_ready             = &imx27_nand_ready,
 };
index 7d9cc8b..7676d1b 100644 (file)
@@ -61,7 +61,6 @@ static int do_data_output (struct nand_device *nand);
 
 static int imx31_command (struct nand_device *nand, uint8_t command);
 static int imx31_address (struct nand_device *nand, uint8_t address);
-static int imx31_controller_ready (struct nand_device *nand, int tout);
 
 NAND_DEVICE_COMMAND_HANDLER(imx31_nand_device_command)
 {
@@ -312,11 +311,6 @@ static int imx31_write_data (struct nand_device *nand, uint16_t data)
        return ERROR_NAND_OPERATION_FAILED;
 }
 
-static int imx31_nand_ready (struct nand_device *nand, int timeout)
-{
-       return imx31_controller_ready (nand, timeout);
-}
-
 static int imx31_reset (struct nand_device *nand)
 {
        /*
@@ -438,7 +432,7 @@ static int imx31_address (struct nand_device *nand, uint8_t address)
        return ERROR_OK;
 }
 
-static int imx31_controller_ready (struct nand_device *nand, int tout)
+static int imx31_nand_ready (struct nand_device *nand, int tout)
 {
        uint16_t poll_complete_status;
        struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
@@ -876,6 +870,5 @@ struct nand_flash_controller imx31_nand_flash_controller = {
                .read_data = &imx31_read_data,
                .write_page = &imx31_write_page,
                .read_page = &imx31_read_page,
-               .controller_ready = &imx31_controller_ready,
                .nand_ready = &imx31_nand_ready,
        };
index ab490ae..565ad72 100644 (file)
@@ -52,11 +52,6 @@ static int nonce_nand_reset(struct nand_device *nand)
        return nonce_nand_command(nand, NAND_CMD_RESET);
 }
 
-static int nonce_nand_controller_ready(struct nand_device *nand, int timeout)
-{
-       return true;
-}
-
 NAND_DEVICE_COMMAND_HANDLER(nonce_nand_device_command)
 {
        return ERROR_OK;
@@ -79,5 +74,4 @@ struct nand_flash_controller nonce_nand_controller =
        .read_data              = &nonce_nand_read,
        .write_data             = &nonce_nand_write,
        .write_block_data       = &nonce_nand_fast_block_write,
-       .controller_ready       = &nonce_nand_controller_ready,
 };
index b46ffae..3ab2364 100644 (file)
@@ -116,11 +116,6 @@ static int orion_nand_reset(struct nand_device *nand)
        return orion_nand_command(nand, NAND_CMD_RESET);
 }
 
-static int orion_nand_controller_ready(struct nand_device *nand, int timeout)
-{
-       return 1;
-}
-
 NAND_DEVICE_COMMAND_HANDLER(orion_nand_device_command)
 {
        struct orion_nand_controller *hw;
@@ -175,7 +170,6 @@ struct nand_flash_controller orion_nand_controller =
        .write_data             = orion_nand_write,
        .write_block_data       = orion_nand_fast_block_write,
        .reset                  = orion_nand_reset,
-       .controller_ready       = orion_nand_controller_ready,
        .nand_device_command    = orion_nand_device_command,
        .init                   = orion_nand_init,
 };
index 3c391bc..1827c74 100644 (file)
@@ -118,6 +118,5 @@ struct nand_flash_controller s3c2410_nand_controller = {
                .read_data = &s3c2410_read_data,
                .write_page = s3c24xx_write_page,
                .read_page = s3c24xx_read_page,
-               .controller_ready = &s3c24xx_controller_ready,
                .nand_ready = &s3c2410_nand_ready,
        };
index 5784305..f43f8a6 100644 (file)
@@ -74,6 +74,5 @@ struct nand_flash_controller s3c2412_nand_controller = {
                .read_page = s3c24xx_read_page,
                .write_block_data = &s3c2440_write_block_data,
                .read_block_data = &s3c2440_read_block_data,
-               .controller_ready = &s3c24xx_controller_ready,
                .nand_ready = &s3c2440_nand_ready,
        };
index d1a421e..797ce24 100644 (file)
@@ -166,6 +166,5 @@ struct nand_flash_controller s3c2440_nand_controller = {
                .read_page = s3c24xx_read_page,
                .write_block_data = &s3c2440_write_block_data,
                .read_block_data = &s3c2440_read_block_data,
-               .controller_ready = &s3c24xx_controller_ready,
                .nand_ready = &s3c2440_nand_ready,
        };
index d341477..5fb2d92 100644 (file)
@@ -75,6 +75,5 @@ struct nand_flash_controller s3c2443_nand_controller = {
                .read_page = s3c24xx_read_page,
                .write_block_data = &s3c2440_write_block_data,
                .read_block_data = &s3c2440_read_block_data,
-               .controller_ready = &s3c24xx_controller_ready,
                .nand_ready = &s3c2440_nand_ready,
        };
index d305b22..e3b5c2e 100644 (file)
@@ -126,8 +126,3 @@ int s3c24xx_read_data(struct nand_device *nand, void *data)
        target_read_u8(target, s3c24xx_info->data, data);
        return ERROR_OK;
 }
-
-int s3c24xx_controller_ready(struct nand_device *nand, int timeout)
-{
-       return 1;
-}
index 9424cb3..059c84d 100644 (file)
@@ -68,8 +68,6 @@ int s3c24xx_address(struct nand_device *nand, uint8_t address);
 int s3c24xx_write_data(struct nand_device *nand, uint16_t data);
 int s3c24xx_read_data(struct nand_device *nand, void *data);
 
-int s3c24xx_controller_ready(struct nand_device *nand, int tout);
-
 #define s3c24xx_write_page NULL
 #define s3c24xx_read_page NULL
 
index 20b6cc1..960447d 100644 (file)
@@ -71,6 +71,5 @@ struct nand_flash_controller s3c6400_nand_controller = {
                .read_page = s3c24xx_read_page,
                .write_block_data = &s3c2440_write_block_data,
                .read_block_data = &s3c2440_read_block_data,
-               .controller_ready = &s3c24xx_controller_ready,
                .nand_ready = &s3c2440_nand_ready,
        };