dfu: rename dfu_tftp_write() to dfu_write_by_name()

This function is essentially independent from tftp, and will also be
utilised in implementing UEFI capsule update in a later commit.
So just give it a more generic name.
In addition, a new configuration option, CONFIG_DFU_WRITE_ALT, was
introduced so that the file will be compiled with different options,
particularly one added in a later commit.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
AKASHI Takahiro 2020-10-29 13:47:41 +09:00 committed by Heinrich Schuchardt
parent 3139356446
commit 045fd8b13d
5 changed files with 41 additions and 22 deletions

View file

@ -324,8 +324,9 @@ got_update_file:
}
} else if (fit_image_check_type(fit, noffset,
IH_TYPE_FIRMWARE)) {
ret = dfu_tftp_write(fit_image_name, update_addr,
update_size, interface, devstring);
ret = dfu_write_by_name(fit_image_name, update_addr,
update_size, interface,
devstring);
if (ret)
return ret;
}