PEL: DRAM: Fixing the missed comma in lg2 trace
Root Cause: In commit afba316, two traces in the lg2 logging missed a
comma, leading to a compilation error.
Solution: The lg2 traces have been corrected by adding the missing
comma. Additionally, the systemd signal subscription and
unsubscription logic has been moved outside of the PEL_ENABLE_PHAL
flag, as it is not dependent on PHAL.
Change-Id: Ib8b17af95be356c6649c7804e4e46704498f3f3d
Signed-off-by: Arya K Padman <aryakpadman@gmail.com>
diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index 2ae9f1a..d71b33e 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -233,10 +233,11 @@
}
}));
-#ifdef PEL_ENABLE_PHAL
if (isPHALDevTreeExist())
{
+#ifdef PEL_ENABLE_PHAL
initPHAL();
+#endif
}
else
{
@@ -244,7 +245,6 @@
// PHAL libraries
subscribeToSystemdSignals();
}
-#endif // PEL_ENABLE_PHAL
}
DBusPropertyMap DataInterface::getAllProperties(
@@ -1111,7 +1111,6 @@
setFruPresent(locCode);
}
-#ifdef PEL_ENABLE_PHAL
bool DataInterface::isPHALDevTreeExist() const
{
try
@@ -1130,6 +1129,7 @@
return false;
}
+#ifdef PEL_ENABLE_PHAL
void DataInterface::initPHAL()
{
if (setenv("PDBG_DTB", PDBG_DTB_PATH, 1))
@@ -1152,6 +1152,7 @@
return;
}
}
+#endif
void DataInterface::subscribeToSystemdSignals()
{
@@ -1168,9 +1169,8 @@
{
auto* error = msg.get_error();
lg2::error("Failed to subscribe JobRemoved systemd signal, "
- "errorName: {ERR_NAME}, errorMsg: {ERR_MSG}, "
- "ERR_NAME",
- error->name, "ERR_MSG", error->message);
+ "errorName: {ERR_NAME}, errorMsg: {ERR_MSG}, ",
+ "ERR_NAME", error->name, "ERR_MSG", error->message);
return;
}
@@ -1225,12 +1225,13 @@
auto* error = msg.get_error();
lg2::error(
"Failed to unsubscribe from JobRemoved systemd signal, "
- "errorName: {ERR_NAME}, errorMsg: {ERR_MSG}, "
- "ERR_NAME",
- error->name, "ERR_MSG", error->message);
+ "errorName: {ERR_NAME}, errorMsg: {ERR_MSG}, ",
+ "ERR_NAME", error->name, "ERR_MSG", error->message);
return;
}
+#ifdef PEL_ENABLE_PHAL
this->initPHAL();
+#endif
});
}
catch (const sdbusplus::exception_t& e)
@@ -1241,7 +1242,6 @@
"ERROR", e);
}
}
-#endif // PEL_ENABLE_PHAL
} // namespace pels
} // namespace openpower
diff --git a/extensions/openpower-pels/data_interface.hpp b/extensions/openpower-pels/data_interface.hpp
index 7ed5001..713f4cd 100644
--- a/extensions/openpower-pels/data_interface.hpp
+++ b/extensions/openpower-pels/data_interface.hpp
@@ -1000,7 +1000,6 @@
*/
static std::string addLocationCodePrefix(const std::string& locationCode);
-#ifdef PEL_ENABLE_PHAL
/**
* @brief A helper API to check whether the PHAL device tree is exists,
* ensuring the PHAL init API can be invoked.
@@ -1009,12 +1008,14 @@
*/
bool isPHALDevTreeExist() const;
+#ifdef PEL_ENABLE_PHAL
/**
* @brief A helper API to init PHAL libraries
*
* @return None
*/
void initPHAL();
+#endif // PEL_ENABLE_PHAL
/**
* @brief A helper API to subscribe to systemd signals
@@ -1029,7 +1030,6 @@
* @return None
*/
void unsubscribeFromSystemdSignals();
-#endif // PEL_ENABLE_PHAL
/**
* @brief The D-Bus property or interface watchers that have callbacks
@@ -1053,13 +1053,11 @@
*/
sdbusplus::bus_t& _bus;
-#ifdef PEL_ENABLE_PHAL
/**
* @brief Watcher to check "openpower-update-bios-attr-table" service
* is "done" to init PHAL libraires
*/
std::unique_ptr<sdbusplus::bus::match_t> _systemdMatch;
-#endif // PEL_ENABLE_PHAL
/**
* @brief A slot object for async dbus call