Call out GPUs using their inventory path

The existing code was calling out GPUs in the metadata
with 'GPU=GPUn' because at the time the GPUs were not
in the inventory.

Now that the GPUs are in the inventory, they can be called
out using their inventory objects which is the correct
way to do it.

Resolves openbmc/openbmc#2869

Change-Id: Ic7b3ac465d482aade532f75ef10cc05df4928767
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/power-sequencer/ucd90160.cpp b/power-sequencer/ucd90160.cpp
index 79f2915..7f098f7 100644
--- a/power-sequencer/ucd90160.cpp
+++ b/power-sequencer/ucd90160.cpp
@@ -37,6 +37,8 @@
 const auto DRIVER_NAME = "ucd9000"s;
 constexpr auto NUM_PAGES = 16;
 
+constexpr auto INVENTORY_OBJ_PATH = "/xyz/openbmc_project/inventory";
+
 namespace fs = std::experimental::filesystem;
 using namespace gpio;
 using namespace pmbus;
@@ -376,7 +378,8 @@
         {
             errorFound = true;
 
-            auto part = std::get<ucd90160::gpioCalloutField>(gpio);
+            std::string part{INVENTORY_OBJ_PATH};
+            part = part + std::get<ucd90160::gpioCalloutField>(gpio);
             PartCallout callout{type, part};
 
             if (isPartCalledOut(callout))
@@ -424,7 +427,7 @@
 
     report<power_error::GPUPowerFault>(
             metadata::RAW_STATUS(nv.get().c_str()),
-            metadata::GPU(callout.c_str()));
+            metadata::CALLOUT_INVENTORY_PATH(callout.c_str()));
 }
 
 void UCD90160::gpuOverTempError(const std::string& callout)
@@ -437,7 +440,7 @@
 
     report<power_error::GPUOverTemp>(
             metadata::RAW_STATUS(nv.get().c_str()),
-            metadata::GPU(callout.c_str()));
+            metadata::CALLOUT_INVENTORY_PATH(callout.c_str()));
 }
 
 }