summaryrefslogtreecommitdiff
path: root/src/flash/nand.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/flash/nand.h')
-rw-r--r--src/flash/nand.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/flash/nand.h b/src/flash/nand.h
index d96e2889..57076d54 100644
--- a/src/flash/nand.h
+++ b/src/flash/nand.h
@@ -29,10 +29,13 @@
struct nand_device_s;
+#define __NAND_DEVICE_COMMAND(name) \
+ COMMAND_HELPER(name, struct nand_device_s *nand)
+
typedef struct nand_flash_controller_s
{
char *name;
- int (*nand_device_command)(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct nand_device_s *nand);
+ __NAND_DEVICE_COMMAND((*nand_device_command));
int (*register_commands)(struct command_context_s *cmd_ctx);
int (*init)(struct nand_device_s *nand);
int (*reset)(struct nand_device_s *nand);
@@ -48,6 +51,8 @@ typedef struct nand_flash_controller_s
int (*nand_ready)(struct nand_device_s *nand, int timeout);
} nand_flash_controller_t;
+#define NAND_DEVICE_COMMAND_HANDLER(name) static __NAND_DEVICE_COMMAND(name)
+
typedef struct nand_block_s
{
uint32_t offset;