pseq: Add generic failure handling to base class
Use the power sequencer base class to handle failure cases where the
device is not found or a device specific failure can not determined. Add
a error logging convience method. Move the D-Bus object to the base
class.
Signed-off-by: Jim Wright <jlwright@us.ibm.com>
Change-Id: I6f7c2951e83cb892ec0c63018d65d5e241ebe6f0
diff --git a/phosphor-power-sequencer/src/ucd90320_monitor.cpp b/phosphor-power-sequencer/src/ucd90320_monitor.cpp
index af04ff0..d7ef7bb 100644
--- a/phosphor-power-sequencer/src/ucd90320_monitor.cpp
+++ b/phosphor-power-sequencer/src/ucd90320_monitor.cpp
@@ -42,13 +42,13 @@
UCD90320Monitor::UCD90320Monitor(sdbusplus::bus::bus& bus, std::uint8_t i2cBus,
std::uint16_t i2cAddress) :
- PowerSequencerMonitor(),
- bus{bus}, match{bus,
- sdbusplus::bus::match::rules::interfacesAdded() +
- sdbusplus::bus::match::rules::sender(
- "xyz.openbmc_project.EntityManager"),
- std::bind(&UCD90320Monitor::interfacesAddedHandler, this,
- std::placeholders::_1)},
+ PowerSequencerMonitor(bus),
+ match{bus,
+ sdbusplus::bus::match::rules::interfacesAdded() +
+ sdbusplus::bus::match::rules::sender(
+ "xyz.openbmc_project.EntityManager"),
+ std::bind(&UCD90320Monitor::interfacesAddedHandler, this,
+ std::placeholders::_1)},
pmbusInterface{
fmt::format("/sys/bus/i2c/devices/{}-{:04x}", i2cBus, i2cAddress)
.c_str(),