sensors: don't pass excess conn handler
We don't need to pass connection handler to setInitialProperties method
since it already part of the sensor class.
Tested: no changes in behaviour.
Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com>
Change-Id: Icaaccbeaf14e22648a6a1bce381f0f0a606b0ddd
diff --git a/include/sensor.hpp b/include/sensor.hpp
index 40f4223..e966c20 100644
--- a/include/sensor.hpp
+++ b/include/sensor.hpp
@@ -237,15 +237,13 @@
return 1;
}
- void
- setInitialProperties(std::shared_ptr<sdbusplus::asio::connection>& conn,
- const std::string& unit,
- const std::string& label = std::string(),
- size_t thresholdSize = 0)
+ void setInitialProperties(const std::string& unit,
+ const std::string& label = std::string(),
+ size_t thresholdSize = 0)
{
if (readState == PowerState::on || readState == PowerState::biosPost)
{
- setupPowerMatch(conn);
+ setupPowerMatch(dbusConnection);
}
createAssociation(association, configurationPath);
@@ -293,8 +291,8 @@
oldValue = request; // todo, just let the config do this?
threshold.value = request;
thresholds::persistThreshold(configurationPath, objectType,
- threshold, conn, thresSize,
- label);
+ threshold, dbusConnection,
+ thresSize, label);
// Invalidate previously remembered value,
// so new thresholds will be checked during next update,
// even if sensor reading remains unchanged.
@@ -328,7 +326,7 @@
{
valueMutabilityInterface =
std::make_shared<sdbusplus::asio::dbus_interface>(
- conn, sensorInterface->get_object_path(),
+ dbusConnection, sensorInterface->get_object_path(),
valueMutabilityInterfaceName);
valueMutabilityInterface->register_property("Mutable", true);
if (!valueMutabilityInterface->initialize())
@@ -343,7 +341,7 @@
{
availableInterface =
std::make_shared<sdbusplus::asio::dbus_interface>(
- conn, sensorInterface->get_object_path(),
+ dbusConnection, sensorInterface->get_object_path(),
availableInterfaceName);
availableInterface->register_property(
"Available", true, [this](const bool propIn, bool& old) {
@@ -364,7 +362,7 @@
{
operationalInterface =
std::make_shared<sdbusplus::asio::dbus_interface>(
- conn, sensorInterface->get_object_path(),
+ dbusConnection, sensorInterface->get_object_path(),
operationalInterfaceName);
operationalInterface->register_property("Functional", true);
operationalInterface->initialize();
diff --git a/src/ADCSensor.cpp b/src/ADCSensor.cpp
index aaef76d..0638b7d 100644
--- a/src/ADCSensor.cpp
+++ b/src/ADCSensor.cpp
@@ -71,7 +71,7 @@
}
association = objectServer.add_interface(
"/xyz/openbmc_project/sensors/voltage/" + name, association::interface);
- setInitialProperties(conn, sensor_paths::unitVolts);
+ setInitialProperties(sensor_paths::unitVolts);
}
ADCSensor::~ADCSensor()
diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp
index 078d790..6154b6f 100644
--- a/src/CPUSensor.cpp
+++ b/src/CPUSensor.cpp
@@ -84,7 +84,7 @@
association = objectServer.add_interface(interfacePath,
association::interface);
- setInitialProperties(conn, units);
+ setInitialProperties(units);
}
}
diff --git a/src/ExitAirTempSensor.cpp b/src/ExitAirTempSensor.cpp
index fd31473..58f7468 100644
--- a/src/ExitAirTempSensor.cpp
+++ b/src/ExitAirTempSensor.cpp
@@ -183,7 +183,7 @@
association = objectServer.add_interface(
"/xyz/openbmc_project/sensors/airflow/" + name, association::interface);
- setInitialProperties(conn, sensor_paths::unitCFM);
+ setInitialProperties(sensor_paths::unitCFM);
pwmLimitIface =
objectServer.add_interface("/xyz/openbmc_project/control/pwm_limit",
@@ -526,7 +526,7 @@
association = objectServer.add_interface(
"/xyz/openbmc_project/sensors/temperature/" + name,
association::interface);
- setInitialProperties(conn, sensor_paths::unitDegreesC);
+ setInitialProperties(sensor_paths::unitDegreesC);
}
ExitAirTempSensor::~ExitAirTempSensor()
diff --git a/src/ExternalSensor.cpp b/src/ExternalSensor.cpp
index 3401ac4..5fba9b4 100644
--- a/src/ExternalSensor.cpp
+++ b/src/ExternalSensor.cpp
@@ -60,7 +60,7 @@
association =
objectServer.add_interface(objectPath, association::interface);
- setInitialProperties(conn, sensorUnits);
+ setInitialProperties(sensorUnits);
if constexpr (debug)
{
diff --git a/src/HwmonTempSensor.cpp b/src/HwmonTempSensor.cpp
index 9871a5b..09fb33f 100644
--- a/src/HwmonTempSensor.cpp
+++ b/src/HwmonTempSensor.cpp
@@ -75,7 +75,7 @@
thisSensorParameters.typeName +
"/" + name,
association::interface);
- setInitialProperties(conn, thisSensorParameters.units);
+ setInitialProperties(thisSensorParameters.units);
}
HwmonTempSensor::~HwmonTempSensor()
diff --git a/src/IpmbSensor.cpp b/src/IpmbSensor.cpp
index 7c76d3b..0615c86 100644
--- a/src/IpmbSensor.cpp
+++ b/src/IpmbSensor.cpp
@@ -118,7 +118,7 @@
void IpmbSensor::init(void)
{
loadDefaults();
- setInitialProperties(dbusConnection, getSubTypeUnits());
+ setInitialProperties(getSubTypeUnits());
if (initCommand)
{
runInitCmd();
diff --git a/src/MCUTempSensor.cpp b/src/MCUTempSensor.cpp
index e9a84fa..ede2a5e 100644
--- a/src/MCUTempSensor.cpp
+++ b/src/MCUTempSensor.cpp
@@ -90,7 +90,7 @@
void MCUTempSensor::init(void)
{
- setInitialProperties(dbusConnection, sensor_paths::unitDegreesC);
+ setInitialProperties(sensor_paths::unitDegreesC);
read();
}
diff --git a/src/NVMeSensor.cpp b/src/NVMeSensor.cpp
index 254ba24..89b21b0 100644
--- a/src/NVMeSensor.cpp
+++ b/src/NVMeSensor.cpp
@@ -48,7 +48,7 @@
"/xyz/openbmc_project/sensors/temperature/" + name,
association::interface);
- setInitialProperties(conn, sensor_paths::unitDegreesC);
+ setInitialProperties(sensor_paths::unitDegreesC);
}
NVMeSensor::~NVMeSensor()
diff --git a/src/PSUSensor.cpp b/src/PSUSensor.cpp
index c405ef5..99845b5 100644
--- a/src/PSUSensor.cpp
+++ b/src/PSUSensor.cpp
@@ -90,11 +90,11 @@
// register and initialize "Associations" property.
if (label.empty() || tSize == thresholds.size())
{
- setInitialProperties(conn, sensorUnits);
+ setInitialProperties(sensorUnits);
}
else
{
- setInitialProperties(conn, sensorUnits, label, tSize);
+ setInitialProperties(sensorUnits, label, tSize);
}
association = objectServer.add_interface(dbusPath, association::interface);
diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp
index 09194f2..d0051a0 100644
--- a/src/TachSensor.cpp
+++ b/src/TachSensor.cpp
@@ -90,7 +90,7 @@
"/xyz/openbmc_project/sensors/fan_tach/" + name}});
itemAssoc->initialize();
}
- setInitialProperties(conn, sensor_paths::unitRPMs);
+ setInitialProperties(sensor_paths::unitRPMs);
setupRead();
}