diff --git a/cli_classic.c b/cli_classic.c index 991804d11..d0712926f 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -411,7 +411,7 @@ static int do_write(struct flashctx *const flash, const char *const filename, co * ... then update newcontents with contents from files provided to '-i' * args if needed. */ - if (read_buf_from_include_args(flash, newcontents)) + if (read_buf_from_include_args(get_layout(flash), newcontents)) goto _free_ret; if (referencefile) { @@ -445,7 +445,7 @@ static int do_verify(struct flashctx *const flash, const char *const filename) * ... then update newcontents with contents from files provided to '-i' * args if needed. */ - if (read_buf_from_include_args(flash, newcontents)) + if (read_buf_from_include_args(get_layout(flash), newcontents)) goto _free_ret; ret = flashrom_image_verify(flash, newcontents, flash_size); diff --git a/flashrom.c b/flashrom.c index 229a47441..35fdc7da7 100644 --- a/flashrom.c +++ b/flashrom.c @@ -926,14 +926,12 @@ out: * then this will read file data into the corresponding region in the * supplied buffer. * - * @param flashctx Flash context to be used. + * @param layout The layout to be used. * @param buf Chip-sized buffer to write data to * @return 0 on success */ -int read_buf_from_include_args(const struct flashctx *const flash, - unsigned char *buf) +int read_buf_from_include_args(const struct flashrom_layout *const layout, unsigned char *buf) { - const struct flashrom_layout *const layout = get_layout(flash); const struct romentry *entry = NULL; /* diff --git a/include/flash.h b/include/flash.h index 449ed9d1c..3fedb2b67 100644 --- a/include/flash.h +++ b/include/flash.h @@ -423,7 +423,7 @@ void print_banner(void); void list_programmers_linebreak(int startcol, int cols, int paren); int selfcheck(void); int read_buf_from_file(unsigned char *buf, unsigned long size, const char *filename); -int read_buf_from_include_args(const struct flashctx *const flash, unsigned char *buf); +int read_buf_from_include_args(const struct flashrom_layout *const layout, unsigned char *buf); int write_buf_to_file(const unsigned char *buf, unsigned long size, const char *filename); int write_buf_to_include_args(const struct flashctx *const flash, unsigned char *buf); int prepare_flash_access(struct flashctx *, bool read_it, bool write_it, bool erase_it, bool verify_it);