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/include/libpldm/pdr.h b/include/libpldm/pdr.h
index 413ef7a..8ace295 100644
--- a/include/libpldm/pdr.h
+++ b/include/libpldm/pdr.h
@@ -426,6 +426,7 @@
 void pldm_entity_association_pdr_add(pldm_entity_association_tree *tree,
 				     pldm_pdr *repo, bool is_remote,
 				     uint16_t terminus_handle);
+
 /** @brief Add entity association pdr from node
  *
  *  @param[in] node - opaque pointer acting as a handle to an entity node
@@ -437,6 +438,19 @@
 	pldm_entity_node *node, pldm_pdr *repo, pldm_entity **entities,
 	size_t num_entities, bool is_remote, uint16_t terminus_handle);
 
+/** @brief Add entity association pdr from node, or return an error
+ *
+ *  @param[in] node - opaque pointer acting as a handle to an entity node
+ *  @param[in] repo - PDR repo where entity association records should be added
+ *  @param[in] is_remote  - if true, then the PDR is not from this terminus
+ *  @param[in] terminus_handle - terminus handle of the terminus
+ *
+ *  @return 0 on success, -EINVAL if the provided arguments are invalid.
+ */
+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);
+
 /** @brief Add entity association pdr record based on record handle
  *  earlier the records where added in a sequential way alone, with
  *  this change the entity association PDR records gets the new record