pdr: Introduce pldm_entity_association_pdr_add_from_node_check()
pldm_entity_association_pdr_add_from_node_check() returns whether or not
the operation was successful.
pldm_entity_association_pdr_add_from_node() is reimplemented in terms of
pldm_entity_association_pdr_add_from_node_check() with the intent that
it be deprecated once pldm_entity_association_pdr_add_from_node_check()
is stabilised.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I186c377bfc1038195540a6cdfd65db7e1126e869
diff --git a/src/pdr.c b/src/pdr.c
index 7266ecd..bbda618 100644
--- a/src/pdr.c
+++ b/src/pdr.c
@@ -931,9 +931,18 @@
pldm_entity_node *node, pldm_pdr *repo, pldm_entity **entities,
size_t num_entities, bool is_remote, uint16_t terminus_handle)
{
- assert(repo != NULL);
+ int rc = pldm_entity_association_pdr_add_from_node_check(
+ node, repo, entities, num_entities, is_remote, terminus_handle);
+ (void)rc;
+ assert(!rc);
+}
- pldm_entity_association_pdr_add_from_node_with_record_handle(
+LIBPLDM_ABI_TESTING
+int pldm_entity_association_pdr_add_from_node_check(
+ pldm_entity_node *node, pldm_pdr *repo, pldm_entity **entities,
+ size_t num_entities, bool is_remote, uint16_t terminus_handle)
+{
+ return pldm_entity_association_pdr_add_from_node_with_record_handle(
node, repo, entities, num_entities, is_remote, terminus_handle,
0);
}