power-supply: Remove version interface

In power supply monitor, a version interface is created in the PSU
object in inventory (/xyz/openbmc_project/inventory).

With PSU code manager implemented in OpenBMC, the version object is
created under software (/xyz/openbmc_project/software), so the version
interface in inventory is not necessary anymore.

Tested: Verify the version and purpose do not exist anymore in
        /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply[0|1]
        on Witherspoon, after factory reset.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: If61762a79195998a25c56aeec50af724f049ab4f
diff --git a/power-supply/power_supply.cpp b/power-supply/power_supply.cpp
index c10fdf7..aa7588e 100644
--- a/power-supply/power_supply.cpp
+++ b/power-supply/power_supply.cpp
@@ -27,7 +27,6 @@
 #include <org/open_power/Witherspoon/Fault/error.hpp>
 #include <phosphor-logging/log.hpp>
 #include <xyz/openbmc_project/Common/Device/error.hpp>
-#include <xyz/openbmc_project/Software/Version/server.hpp>
 
 #include <functional>
 
@@ -41,7 +40,6 @@
 using namespace phosphor::logging;
 using namespace sdbusplus::org::open_power::Witherspoon::Fault::Error;
 using namespace sdbusplus::xyz::openbmc_project::Common::Device::Error;
-namespace version = sdbusplus::xyz::openbmc_project::Software::server;
 
 PowerSupply::PowerSupply(const std::string& name, size_t inst,
                          const std::string& objpath, const std::string& invpath,
@@ -618,7 +616,6 @@
     using Interfaces = std::map<std::string, Properties>;
     using Object = std::map<object_path, Interfaces>;
     Properties assetProps;
-    Properties versionProps;
     Interfaces interfaces;
     Object object;
 
@@ -644,24 +641,9 @@
             {
             }
         }
-        else if (fru.at("interface") == VERSION_IFACE)
-        {
-            try
-            {
-                versionProps.emplace(
-                    fru.at("propertyName"),
-                    present ? pmbusIntf.readString(fru.at("fileName"),
-                                                   inventoryPMBusAccessType)
-                            : "");
-            }
-            catch (const std::exception& e)
-            {
-            }
-        }
     }
 
     interfaces.emplace(ASSET_IFACE, std::move(assetProps));
-    interfaces.emplace(VERSION_IFACE, std::move(versionProps));
 
     // For Notify(), just send the relative path of the inventory
     // object so remove the INVENTORY_OBJ_PATH prefix
@@ -686,16 +668,6 @@
         method.append(std::move(object));
 
         auto reply = bus.call(method);
-
-        // TODO: openbmc/openbmc#2756
-        // Calling Notify() with an enumerated property crashes inventory
-        // manager, so let it default to Unknown and now set it to the
-        // right value.
-        auto purpose =
-            version::convertForMessage(version::Version::VersionPurpose::Other);
-
-        util::setProperty(VERSION_IFACE, VERSION_PURPOSE_PROP, inventoryPath,
-                          service, bus, purpose);
     }
     catch (std::exception& e)
     {
diff --git a/power-supply/power_supply.hpp b/power-supply/power_supply.hpp
index 550373b..b3410af 100644
--- a/power-supply/power_supply.hpp
+++ b/power-supply/power_supply.hpp
@@ -395,7 +395,6 @@
      * - Part Number
      * - Manufacturer
      * - Model
-     * - Firmware version
      */
     void updateInventory();
 
diff --git a/types.hpp b/types.hpp
index 814c098..e7287d4 100644
--- a/types.hpp
+++ b/types.hpp
@@ -8,7 +8,6 @@
 constexpr auto POWER_IFACE = "org.openbmc.control.Power";
 constexpr auto INVENTORY_MGR_IFACE = "xyz.openbmc_project.Inventory.Manager";
 constexpr auto ASSET_IFACE = "xyz.openbmc_project.Inventory.Decorator.Asset";
-constexpr auto VERSION_IFACE = "xyz.openbmc_project.Software.Version";
 constexpr auto PSU_INVENTORY_IFACE =
     "xyz.openbmc_project.Inventory.Item.PowerSupply";
 
@@ -16,7 +15,6 @@
 constexpr auto MESSAGE_PROP = "Message";
 constexpr auto RESOLVED_PROP = "Resolved";
 constexpr auto PRESENT_PROP = "Present";
-constexpr auto VERSION_PURPOSE_PROP = "Purpose";
 
 constexpr auto INVENTORY_OBJ_PATH = "/xyz/openbmc_project/inventory";
 constexpr auto POWER_OBJ_PATH = "/org/openbmc/control/power0";