Remove Configuration interface prefix from utils APIs
This eliminates some repetitive verbosity from daemons that handle a lot
of different sensor types (such as hwmontempsensor and psusensor). It
also positions us to more cleanly use a single data structure for both
existing APIs like GetSensorConfiguration() and
setupPropertiesChangedMatches(), as well as upcoming I2C
device-management support.
Tested: hwmontempsensor and adcsensor on romed8hm3 continue to behave as
they did previously.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I9d80475ca4160c8d2ff0afab942709496d51238d
diff --git a/src/IntelCPUSensorMain.cpp b/src/IntelCPUSensorMain.cpp
index 2780c1f..485729b 100644
--- a/src/IntelCPUSensorMain.cpp
+++ b/src/IntelCPUSensorMain.cpp
@@ -89,8 +89,7 @@
namespace fs = std::filesystem;
-static constexpr auto sensorTypes{
- std::to_array<const char*>({"xyz.openbmc_project.Configuration.XeonCPU"})};
+static constexpr auto sensorTypes{std::to_array<const char*>({"XeonCPU"})};
static constexpr auto hiddenProps{std::to_array<const char*>(
{IntelCPUSensor::labelTcontrol, "Tthrottle", "Tjmax"})};
@@ -244,7 +243,8 @@
for (const char* type : sensorTypes)
{
sensorType = type;
- auto sensorBase = sensorData->find(sensorType);
+ auto sensorBase =
+ sensorData->find(configInterfaceName(sensorType));
if (sensorBase != sensorData->end())
{
baseConfiguration = &(*sensorBase);
@@ -623,7 +623,7 @@
{
for (const auto& [intf, cfg] : cfgData)
{
- if (intf != type)
+ if (intf != configInterfaceName(type))
{
continue;
}