Commit b0759dfc authored by Antonio Borneo's avatar Antonio Borneo Committed by Øyvind Harboe
Browse files

flash/nand: review NAND driver interface



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: default avatarAntonio Borneo <borneo.antonio@gmail.com>
parent 0136977c
......@@ -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);
};
......
......@@ -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,
};
......@@ -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,
};
......@@ -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,
};
......@@ -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,
};
......@@ -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,
};
......
......@@ -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,
};
......@@ -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,
};
......@@ -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,
};
......@@ -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,
};
......@@ -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;
}
......@@ -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
......
......@@ -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,
};
Supports Markdown
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