return ERROR_OK;
}
-static int davinci_nand_device_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc,
- struct nand_device_s *nand)
+NAND_DEVICE_COMMAND_HANDLER(davinci_nand_device_command)
{
struct davinci_nand *info;
target_t *target;
/* nand device lpc3180 <target#> <oscillator_frequency>
*/
-static int lpc3180_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct nand_device_s *nand)
+NAND_DEVICE_COMMAND_HANDLER(lpc3180_nand_device_command)
{
if (argc < 3)
{
static int imx31_address (struct nand_device_s *nand, uint8_t address);
static int imx31_controller_ready (struct nand_device_s *nand, int tout);
-static int imx31_nand_device_command (struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc,
- struct nand_device_s *nand)
+NAND_DEVICE_COMMAND_HANDLER(imx31_nand_device_command)
{
mx3_nf_controller_t *mx3_nf_info;
mx3_nf_info = malloc (sizeof (mx3_nf_controller_t));
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);
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;
return ERROR_OK;
}
-int orion_nand_device_command(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc,
- struct nand_device_s *nand)
+NAND_DEVICE_COMMAND_HANDLER(orion_nand_device_command)
{
orion_nand_controller_t *hw;
uint32_t base;
#include "s3c24xx_nand.h"
-static int s3c2410_nand_device_command(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc,
- struct nand_device_s *nand)
+NAND_DEVICE_COMMAND_HANDLER(s3c2410_nand_device_command)
{
s3c24xx_nand_controller_t *info;
CALL_S3C24XX_DEVICE_COMMAND(nand, &info);
#include "s3c24xx_nand.h"
-static int s3c2412_nand_device_command(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc,
- struct nand_device_s *nand)
+NAND_DEVICE_COMMAND_HANDLER(s3c2412_nand_device_command)
{
s3c24xx_nand_controller_t *info;
CALL_S3C24XX_DEVICE_COMMAND(nand, &info);
#include "s3c24xx_nand.h"
-static int s3c2440_nand_device_command(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc,
- struct nand_device_s *nand)
+NAND_DEVICE_COMMAND_HANDLER(s3c2440_nand_device_command)
{
s3c24xx_nand_controller_t *info;
CALL_S3C24XX_DEVICE_COMMAND(nand, &info);
#include "s3c24xx_nand.h"
-static int s3c2443_nand_device_command(struct command_context_s *cmd_ctx, char *cmd,
- char **args, int argc,
- struct nand_device_s *nand)
+NAND_DEVICE_COMMAND_HANDLER(s3c2443_nand_device_command)
{
s3c24xx_nand_controller_t *info;
CALL_S3C24XX_DEVICE_COMMAND(nand, &info);