mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
cmd: crosec: Move cros_ec_decode_region helper to cmd/cros_ec.c
The cros_ec_decode_region() function is only used in combination with the crosec cmds. Move the function to the correct place. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Cc: Simon Glass <sjg@chromium.org> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: u-boot@lists.denx.de Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:

committed by
Simon Glass

parent
ae6acf9fe2
commit
a2558e8729
@ -19,6 +19,29 @@ static const char * const ec_current_image_name[] = {"unknown", "RO", "RW"};
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/**
|
||||
* Decode a flash region parameter
|
||||
*
|
||||
* @param argc Number of params remaining
|
||||
* @param argv List of remaining parameters
|
||||
* @return flash region (EC_FLASH_REGION_...) or -1 on error
|
||||
*/
|
||||
static int cros_ec_decode_region(int argc, char * const argv[])
|
||||
{
|
||||
if (argc > 0) {
|
||||
if (0 == strcmp(*argv, "rw"))
|
||||
return EC_FLASH_REGION_RW;
|
||||
else if (0 == strcmp(*argv, "ro"))
|
||||
return EC_FLASH_REGION_RO;
|
||||
|
||||
debug("%s: Invalid region '%s'\n", __func__, *argv);
|
||||
} else {
|
||||
debug("%s: Missing region parameter\n", __func__);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a flash read or write command
|
||||
*
|
||||
|
Reference in New Issue
Block a user