Revert "pldm: use std::expected for instance ID allocation"
This reverts commit 70262ed7bf854b25d4b65628bc3c892ddfe9380f.
Change-Id: I1f54d6b60bf3cfa9f00764140eec6167e1e182d6
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
diff --git a/platform-mc/terminus_manager.cpp b/platform-mc/terminus_manager.cpp
index bd77fe6..d90b6cf 100644
--- a/platform-mc/terminus_manager.cpp
+++ b/platform-mc/terminus_manager.cpp
@@ -464,12 +464,7 @@
exec::task<int> TerminusManager::getTidOverMctp(mctp_eid_t eid, pldm_tid_t* tid)
{
- auto instanceIdResult = pldm::utils::getInstanceId(instanceIdDb.next(eid));
- if (!instanceIdResult)
- {
- co_return PLDM_ERROR;
- }
- auto instanceId = instanceIdResult.value();
+ auto instanceId = instanceIdDb.next(eid);
Request request(sizeof(pldm_msg_hdr));
auto requestMsg = new (request.data()) pldm_msg;
auto rc = encode_get_tid_req(instanceId, requestMsg);
@@ -515,12 +510,7 @@
exec::task<int> TerminusManager::setTidOverMctp(mctp_eid_t eid, pldm_tid_t tid)
{
- auto instanceIdResult = pldm::utils::getInstanceId(instanceIdDb.next(eid));
- if (!instanceIdResult)
- {
- co_return PLDM_ERROR;
- }
- auto instanceId = instanceIdResult.value();
+ auto instanceId = instanceIdDb.next(eid);
Request request(sizeof(pldm_msg_hdr) + sizeof(pldm_set_tid_req));
auto requestMsg = new (request.data()) pldm_msg;
auto rc = encode_set_tid_req(instanceId, tid, requestMsg);
@@ -694,12 +684,7 @@
auto eid = std::get<0>(mctpInfo.value());
auto requestMsg = new (request.data()) pldm_msg;
- auto instanceIdResult = pldm::utils::getInstanceId(instanceIdDb.next(eid));
- if (!instanceIdResult)
- {
- co_return PLDM_ERROR;
- }
- requestMsg->hdr.instance_id = instanceIdResult.value();
+ requestMsg->hdr.instance_id = instanceIdDb.next(eid);
auto rc = co_await sendRecvPldmMsgOverMctp(eid, request, responseMsg,
responseLen);