psu-ng: Dynamically assign the device driver name
Replaced hardcoded device driver name with a method to build the device
driver name dynamically and assign it to a private data member.
The dynamically built device driver name used during bind/unbind.
Tested the changes in simulation and actual system, compared journalctl
entries of phosphor-psu-monitor with modified phosphor-psu-monitor. The
following test were conducted and verified same journal output:
- Verified driver name assigned correcty to PSU
- Good Machine Path
- Removed Power Supply
- Inserted Power Supply
- Missing Power Supply
Change-Id: Ic376d4ff058e9a2df1887468932faaa28d998960
Signed-off-by: Faisal Awada <faisal@us.ibm.com>
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index c28c11e..5db6714 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -50,6 +50,8 @@
// than PGOOD_DEGLITCH_LIMIT.
constexpr auto AC_FAULT_LIMIT = 6;
+constexpr auto IBMCFFPS_DD_NAME = "ibm-cffps";
+
using SensorInterface = sdbusplus::xyz::openbmc_project::Sensor::server::Value;
using SensorObject = sdbusplus::server::object_t<SensorInterface>;
@@ -1038,6 +1040,11 @@
* again (though that could be done as a future improvement).
*/
std::unique_ptr<SensorObject> inputVoltageRatingIface;
+
+ /**
+ * @brief The device driver name
+ */
+ std::string driverName;
};
} // namespace phosphor::power::psu