]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dfu: unify mmc/nand read/write ops enum
authorAfzal Mohammed <afzal.mohd.ma@gmail.com>
Tue, 17 Sep 2013 19:44:50 +0000 (01:14 +0530)
committerMarek Vasut <marex@denx.de>
Tue, 24 Sep 2013 15:51:35 +0000 (17:51 +0200)
MMC and NAND independently defines same enumerators for read/write.
Unify them by defining enum in dfu header. RAM support that is being
added newly also can make use of it.

Signed-off-by: Afzal Mohammed <afzal.mohd.ma@gmail.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
drivers/dfu/dfu_mmc.c
drivers/dfu/dfu_nand.c
include/dfu.h

index 0871a770b7b1d9b9bfc8c23a02701766345d76a1..f942758696e326843368847d0ef947b8be41d32b 100644 (file)
 #include <div64.h>
 #include <dfu.h>
 
-enum dfu_mmc_op {
-       DFU_OP_READ = 1,
-       DFU_OP_WRITE,
-};
-
 static unsigned char __aligned(CONFIG_SYS_CACHELINE_SIZE)
                                dfu_file_buf[CONFIG_SYS_DFU_MAX_FILE_SIZE];
 static long dfu_file_buf_len;
 
-static int mmc_block_op(enum dfu_mmc_op op, struct dfu_entity *dfu,
+static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
                        u64 offset, void *buf, long *len)
 {
        char cmd_buf[DFU_CMD_BUF_SIZE];
@@ -65,7 +60,7 @@ static int mmc_file_buffer(struct dfu_entity *dfu, void *buf, long *len)
        return 0;
 }
 
-static int mmc_file_op(enum dfu_mmc_op op, struct dfu_entity *dfu,
+static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
                        void *buf, long *len)
 {
        char cmd_buf[DFU_CMD_BUF_SIZE];
index 0ec12cff264fe8ad88117f8fe8748851cf0d4e85..edbf5a97b9001a84cd93570884f6aee5372cdc96 100644 (file)
 #include <jffs2/load_kernel.h>
 #include <nand.h>
 
-enum dfu_nand_op {
-       DFU_OP_READ = 1,
-       DFU_OP_WRITE,
-};
-
-static int nand_block_op(enum dfu_nand_op op, struct dfu_entity *dfu,
+static int nand_block_op(enum dfu_op op, struct dfu_entity *dfu,
                        u64 offset, void *buf, long *len)
 {
        loff_t start, lim;
index 392cef126e28cde65c5301c1092f7f6faf2af1cd..6a3e253b1df56abaeb1b313fbf8184394d41c6df 100644 (file)
@@ -29,6 +29,11 @@ enum dfu_layout {
        DFU_FS_EXT4,
 };
 
+enum dfu_op {
+       DFU_OP_READ = 1,
+       DFU_OP_WRITE,
+};
+
 struct mmc_internal_data {
        /* RAW programming */
        unsigned int lba_start;