diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2019-01-30 16:27:38 -0600 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2019-02-13 14:31:44 -0600 |
commit | 0a1f686cb44a19a4c459cfe2cbb3cc565749066d (patch) | |
tree | 72c42b079ba951f41a500cbb9e98caea0a50f03d /control/zone.cpp | |
parent | 18c9103015fd4218146cd75b9e99bb745d97cf76 (diff) | |
download | phosphor-fan-presence-0a1f686cb44a19a4c459cfe2cbb3cc565749066d.tar.gz phosphor-fan-presence-0a1f686cb44a19a4c459cfe2cbb3cc565749066d.zip |
Use zone object's path attribute
A zone's object path is set when the zone is created and available to be
used instead of determining the zone's object path each time.
Change-Id: Iddfebd1545bb49054d95f8c19a71b2fbf9c2f592
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'control/zone.cpp')
-rw-r--r-- | control/zone.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/control/zone.cpp b/control/zone.cpp index 7a5f926..326ca68 100644 --- a/control/zone.cpp +++ b/control/zone.cpp @@ -329,14 +329,11 @@ void Zone::initEvent(const SetSpeedEvent& event) // When match is empty, handle if zone object member if (std::get<sigMatchPos>(sig).empty()) { - fs::path path{CONTROL_OBJPATH}; - path /= std::to_string(_zoneNum); - // Set event data for each host group member for (auto it = std::get<groupPos>(event).begin(); it != std::get<groupPos>(event).end(); ++it) { - if (it->first == path.string()) + if (it->first == _path) { // Group member interface in list owned by zone if (std::find(_ifaces.begin(), _ifaces.end(), @@ -643,9 +640,7 @@ std::string Zone::current(std::string value) current = ThermalObject::current(value); saveCurrentMode(); // Trigger event(s) for custom mode property change - fs::path path{CONTROL_OBJPATH}; - path /= std::to_string(_zoneNum); - auto eData = _objects[path.string()] + auto eData = _objects[_path] ["xyz.openbmc_project.Control.ThermalMode"] ["Current"]; if (eData != nullptr) |