FruDevice: Fix ReScanBus behavior on mux buses
In commit d8884f1 ("Fix for devices behind the mux being wrongly
detected on lower bus address"), FruDevice skips will not add the
FRU object to DBus if it is already found on a lower numbered bus.
But it doen't check the bus number, meaning that it also skips the
bus it is on, causing rescan on mux buses not working. This patch
fixes it by comparing the bus number.
Tested:
Verified the behavior of ReScanBus method are the same on mux and
non-mux buses by adding some logs.
Change-Id: I668c489af6365ec1e8d4e6994b2fe29bc562378f
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
diff --git a/src/FruDevice.cpp b/src/FruDevice.cpp
index ec42eca..86644fd 100644
--- a/src/FruDevice.cpp
+++ b/src/FruDevice.cpp
@@ -687,7 +687,8 @@
std::string path = busIface.second->get_object_path();
if (std::regex_match(path, std::regex(productName + "(_\\d+|)$")))
{
- if (isMuxBus(bus) && address == busIface.first.second &&
+ if (isMuxBus(bus) && bus != busIface.first.first &&
+ address == busIface.first.second &&
(getFRUInfo(static_cast<uint8_t>(busIface.first.first),
static_cast<uint8_t>(busIface.first.second)) ==
getFRUInfo(static_cast<uint8_t>(bus),