TachSensor: Support multiple fans on the same GPIO

On IBM SBP1 two fans share the same enclosure, even though they can be
controlled independently as they have two distinct I2C PWM controllers
with separate temperature sensors.
The fan enclosure occupies only one GPIO for presence detection.

Allow the same presence GPIO to be used within multiple TachSensors.

TEST: Used the same GPIO on two I2CFans, both disappear when unplugged.

Change-Id: I946e4579a361f00512eb707d2e5eb3b9ec7f2a55
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp
index 5019fd5..b31c1b7 100644
--- a/src/TachSensor.cpp
+++ b/src/TachSensor.cpp
@@ -47,7 +47,7 @@
 TachSensor::TachSensor(const std::string& path, const std::string& objectType,
                        sdbusplus::asio::object_server& objectServer,
                        std::shared_ptr<sdbusplus::asio::connection>& conn,
-                       std::unique_ptr<PresenceSensor>&& presenceSensor,
+                       std::shared_ptr<PresenceSensor>& presenceSensor,
                        std::optional<RedundancySensor>* redundancy,
                        boost::asio::io_context& io, const std::string& fanName,
                        std::vector<thresholds::Threshold>&& thresholdsIn,
@@ -58,8 +58,7 @@
     Sensor(escapeName(fanName), std::move(thresholdsIn), sensorConfiguration,
            objectType, false, false, limits.second, limits.first, conn,
            powerState),
-    objServer(objectServer), redundancy(redundancy),
-    presence(std::move(presenceSensor)),
+    objServer(objectServer), redundancy(redundancy), presence(presenceSensor),
     inputDev(io, path, boost::asio::random_access_file::read_only),
     waitTimer(io), path(path), led(ledIn)
 {