]> git.sur5r.net Git - openocd/blobdiff - src/flash/nor/em357.c
flash: Constify write buffer
[openocd] / src / flash / nor / em357.c
index 49aee7e89b20ae87fc0b292be8bf20a8c8b99b3a..70a5431ac68880b2827bbc1984a4db091edd6d3e 100644 (file)
@@ -455,7 +455,7 @@ static int em357_protect(struct flash_bank *bank, int set, int first, int last)
        return em357_write_options(bank);
 }
 
-static int em357_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int em357_write_block(struct flash_bank *bank, const uint8_t *buffer,
        uint32_t offset, uint32_t count)
 {
        struct target *target = bank->target;
@@ -505,7 +505,7 @@ static int em357_write_block(struct flash_bank *bank, uint8_t *buffer,
        ;
 
        retval = target_write_buffer(target, write_algorithm->address,
-                       sizeof(em357_flash_write_code), (uint8_t *)em357_flash_write_code);
+                       sizeof(em357_flash_write_code), em357_flash_write_code);
        if (retval != ERROR_OK)
                return retval;
 
@@ -583,7 +583,7 @@ static int em357_write_block(struct flash_bank *bank, uint8_t *buffer,
        return retval;
 }
 
-static int em357_write(struct flash_bank *bank, uint8_t *buffer,
+static int em357_write(struct flash_bank *bank, const uint8_t *buffer,
        uint32_t offset, uint32_t count)
 {
        struct target *target = bank->target;
@@ -751,13 +751,6 @@ static int em357_auto_probe(struct flash_bank *bank)
        return em357_probe(bank);
 }
 
-
-static int get_em357_info(struct flash_bank *bank, char *buf, int buf_size)
-{
-       snprintf(buf, buf_size, "em357\n");
-       return ERROR_OK;
-}
-
 COMMAND_HANDLER(em357_handle_lock_command)
 {
        struct target *target = NULL;
@@ -946,5 +939,4 @@ struct flash_driver em357_flash = {
        .auto_probe = em357_auto_probe,
        .erase_check = default_flash_blank_check,
        .protect_check = em357_protect_check,
-       .info = get_em357_info,
 };