diff options
author | Claudio Carvalho <cclaudio@linux.vnet.ibm.com> | 2017-12-09 02:52:17 -0200 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-18 21:30:57 -0600 |
commit | 75dbbe674c0fbe97cf64e96fd3b5ed2f3cd5efa6 (patch) | |
tree | 7bbe224d0e3e1c13b36f074c330fae96ee7f4ec5 /core/flash.c | |
parent | 594c7a6ae3cccd4a7eeb5ce2c31d2f958672325c (diff) | |
download | skiboot-75dbbe674c0fbe97cf64e96fd3b5ed2f3cd5efa6.zip skiboot-75dbbe674c0fbe97cf64e96fd3b5ed2f3cd5efa6.tar.gz skiboot-75dbbe674c0fbe97cf64e96fd3b5ed2f3cd5efa6.tar.bz2 |
core/flash.c: extern function to get the name of a PNOR partition
This adds the flash_map_resource_name() to allow skiboot subsystems to
lookup the name of a PNOR partition. Thus, we don't need to duplicate
the same information in other places (e.g. libstb).
Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/flash.c')
-rw-r--r-- | core/flash.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/flash.c b/core/flash.c index 2744496..66568e7 100644 --- a/core/flash.c +++ b/core/flash.c @@ -537,6 +537,16 @@ static struct { { RESOURCE_ID_VERSION, RESOURCE_SUBID_NONE, "VERSION" }, }; +const char *flash_map_resource_name(enum resource_id id) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(part_name_map); i++) { + if (part_name_map[i].id == id) + return part_name_map[i].name; + } + return NULL; +} static size_t sizeof_elf_from_hdr(void *buf) { |