diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index 1477806..c57593d 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -370,15 +370,25 @@
     return expandedLocationCode;
 }
 
-std::string DataInterface::getInventoryFromLocCode(
-    const std::string& unexpandedLocationCode, uint16_t node) const
+std::string
+    DataInterface::getInventoryFromLocCode(const std::string& locationCode,
+                                           uint16_t node, bool expanded) const
 {
-    auto method = _bus.new_method_call(
-        service_name::vpdManager, object_path::vpdManager,
-        interface::vpdManager, "GetFRUsByUnexpandedLocationCode");
+    std::string methodName = expanded ? "GetFRUsByExpandedLocationCode"
+                                      : "GetFRUsByUnexpandedLocationCode";
 
-    method.append(addLocationCodePrefix(unexpandedLocationCode),
-                  static_cast<uint16_t>(0));
+    auto method =
+        _bus.new_method_call(service_name::vpdManager, object_path::vpdManager,
+                             interface::vpdManager, methodName.c_str());
+
+    if (expanded)
+    {
+        method.append(locationCode);
+    }
+    else
+    {
+        method.append(addLocationCodePrefix(locationCode), node);
+    }
 
     auto reply = _bus.call(method);
 
diff --git a/extensions/openpower-pels/data_interface.hpp b/extensions/openpower-pels/data_interface.hpp
index 944de05..2a80dba 100644
--- a/extensions/openpower-pels/data_interface.hpp
+++ b/extensions/openpower-pels/data_interface.hpp
@@ -263,16 +263,23 @@
      * @brief Returns the inventory path for the FRU that the location
      *        code represents.
      *
-     * @param[in] locationCode - Location code value starting with Ufcs-, and
-     *                           if that isn't present it will be added first.
+     * @param[in] locationCode - If an expanded location code, then the
+     *                           full location code.
+     *                           If not expanded, a location code value
+     *                           starting with Ufcs-, and if that isn't
+     *                           present it will be added first.
      *
-     * @param[in] node - The node number the location is on.
+     * @param[in] node - The node number the location is on.  Ignored if the
+     *                   expanded location code is passed in.
+     *
+     * @param[in] expanded - If the location code already has the relevent
+     *                       VPD fields embedded in it.
      *
      * @return std::string - The inventory D-Bus object
      */
-    virtual std::string
-        getInventoryFromLocCode(const std::string& unexpandedLocationCode,
-                                uint16_t node) const = 0;
+    virtual std::string getInventoryFromLocCode(const std::string& LocationCode,
+                                                uint16_t node,
+                                                bool expanded) const = 0;
 
   protected:
     /**
@@ -483,15 +490,23 @@
      * @brief Returns the inventory path for the FRU that the location
      *        code represents.
      *
-     * @param[in] locationCode - Location code value starting with Ufcs-, and
-     *                           if that isn't present it will be added first.
+     * @param[in] locationCode - If an expanded location code, then the
+     *                           full location code.
+     *                           If not expanded, a location code value
+     *                           starting with Ufcs-, and if that isn't
+     *                           present it will be added first.
      *
-     * @param[in] node - The node number the location is on.
+     * @param[in] node - The node number the location is on.  Ignored if the
+     *                   expanded location code is passed in.
+     *
+     * @param[in] expanded - If the location code already has the relevent
+     *                       VPD fields embedded in it.
      *
      * @return std::string - The inventory D-Bus object
      */
-    std::string getInventoryFromLocCode(const std::string& expandedLocationCode,
-                                        uint16_t node) const override;
+    std::string getInventoryFromLocCode(const std::string& locationCode,
+                                        uint16_t node,
+                                        bool expanded) const override;
 
   private:
     /**
diff --git a/extensions/openpower-pels/src.cpp b/extensions/openpower-pels/src.cpp
index b96cb8f..b3a7693 100644
--- a/extensions/openpower-pels/src.cpp
+++ b/extensions/openpower-pels/src.cpp
@@ -671,7 +671,7 @@
         {
             // Get the inventory item from the unexpanded location code
             inventoryPath =
-                dataIface.getInventoryFromLocCode(regCallout.locCode, 0);
+                dataIface.getInventoryFromLocCode(regCallout.locCode, 0, false);
         }
         catch (const std::exception& e)
         {
@@ -781,8 +781,8 @@
 
         try
         {
-            auto inventoryPath =
-                dataIface.getInventoryFromLocCode(callout.locationCode, 0);
+            auto inventoryPath = dataIface.getInventoryFromLocCode(
+                callout.locationCode, 0, false);
 
             addInventoryCallout(inventoryPath, priority, std::nullopt,
                                 dataIface);
diff --git a/test/openpower-pels/mocks.hpp b/test/openpower-pels/mocks.hpp
index e291966..0e55ecf 100644
--- a/test/openpower-pels/mocks.hpp
+++ b/test/openpower-pels/mocks.hpp
@@ -39,7 +39,7 @@
     MOCK_METHOD(std::string, expandLocationCode, (const std::string&, uint16_t),
                 (const override));
     MOCK_METHOD(std::string, getInventoryFromLocCode,
-                (const std::string&, uint16_t), (const override));
+                (const std::string&, uint16_t, bool), (const override));
 
     void changeHostState(bool newState)
     {
diff --git a/test/openpower-pels/pel_test.cpp b/test/openpower-pels/pel_test.cpp
index d643076..b7047cc 100644
--- a/test/openpower-pels/pel_test.cpp
+++ b/test/openpower-pels/pel_test.cpp
@@ -817,7 +817,7 @@
                     "/xyz/openbmc_project/inventory/chassis/motherboard/cpu0"))
         .WillOnce(Return("UXXX-P1"));
 
-    EXPECT_CALL(dataIface, getInventoryFromLocCode("P1", 0))
+    EXPECT_CALL(dataIface, getInventoryFromLocCode("P1", 0, false))
         .WillOnce(
             Return("/xyz/openbmc_project/inventory/chassis/motherboard/cpu0"));
 
diff --git a/test/openpower-pels/src_test.cpp b/test/openpower-pels/src_test.cpp
index cac653a..c4c9d40 100644
--- a/test/openpower-pels/src_test.cpp
+++ b/test/openpower-pels/src_test.cpp
@@ -618,11 +618,11 @@
         EXPECT_CALL(dataIface, expandLocationCode("P0-C9", 0))
             .WillOnce(Return("UXXX-P0-C9"));
 
-        EXPECT_CALL(dataIface, getInventoryFromLocCode("P0-C8", 0))
+        EXPECT_CALL(dataIface, getInventoryFromLocCode("P0-C8", 0, false))
             .WillOnce(Return(
                 "/xyz/openbmc_project/inventory/chassis/motherboard/cpu0"));
 
-        EXPECT_CALL(dataIface, getInventoryFromLocCode("P0-C9", 0))
+        EXPECT_CALL(dataIface, getInventoryFromLocCode("P0-C9", 0, false))
             .WillOnce(Return(
                 "/xyz/openbmc_project/inventory/chassis/motherboard/cpu1"));
 
@@ -721,17 +721,17 @@
         .Times(5)
         .WillRepeatedly(ReturnRef(names));
 
-    EXPECT_CALL(dataIface, getInventoryFromLocCode("P1-C40", 0))
+    EXPECT_CALL(dataIface, getInventoryFromLocCode("P1-C40", 0, false))
         .Times(3)
         .WillRepeatedly(
             Return("/xyz/openbmc_project/inventory/chassis/motherboard/cpu0"));
 
-    EXPECT_CALL(dataIface, getInventoryFromLocCode("P1", 0))
+    EXPECT_CALL(dataIface, getInventoryFromLocCode("P1", 0, false))
         .Times(3)
         .WillRepeatedly(
             Return("/xyz/openbmc_project/inventory/chassis/motherboard"));
 
-    EXPECT_CALL(dataIface, getInventoryFromLocCode("P1-C15", 0))
+    EXPECT_CALL(dataIface, getInventoryFromLocCode("P1-C15", 0, false))
         .Times(3)
         .WillRepeatedly(
             Return("/xyz/openbmc_project/inventory/chassis/motherboard/bmc"));
