psusensor: Convert sensorTypes to I2CDeviceTypeMap
Similar to change
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/56127.
Tested: same sensors get initialized before and after change.
Change-Id: I57aca3738b01aa22da4dab5d8b1ed251578d9123
Signed-off-by: Matt Simmering <matthew.simmering@intel.com>
diff --git a/src/DeviceMgmt.hpp b/src/DeviceMgmt.hpp
index 07b28b5..c8c76f1 100644
--- a/src/DeviceMgmt.hpp
+++ b/src/DeviceMgmt.hpp
@@ -14,8 +14,16 @@
bool createsHWMon;
};
+struct I2CDeviceComparator
+{
+ bool operator()(const std::string& a, const std::string& b) const noexcept
+ {
+ return strcasecmp(a.c_str(), b.c_str()) < 0;
+ }
+};
+
using I2CDeviceTypeMap =
- boost::container::flat_map<std::string, I2CDeviceType, std::less<>>;
+ boost::container::flat_map<std::string, I2CDeviceType, I2CDeviceComparator>;
struct I2CDeviceParams
{