From 87e58097a50926608e296f2da102dd1bf615c8c9 Mon Sep 17 00:00:00 2001 From: Justin Kim Date: Mon, 16 Sep 2024 12:19:38 -0700 Subject: [PATCH] Modify gpio and sysfs path check in config validation. Summary: The check would fail when one of them exist. Reviewed By: rationalis Differential Revision: D62767884 fbshipit-source-id: 5889c854ecef9237526c4bc5c4be8e8c85d03144 --- fboss/platform/fan_service/Utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fboss/platform/fan_service/Utils.cpp b/fboss/platform/fan_service/Utils.cpp index 2bc1888f92e56..932b8c44ff9ec 100644 --- a/fboss/platform/fan_service/Utils.cpp +++ b/fboss/platform/fan_service/Utils.cpp @@ -90,7 +90,7 @@ bool Utils::isValidConfig(const FanServiceConfig& config) { XLOG(ERR) << "ledSysfsPath cannot be empty"; return false; } - if ((!fan.presenceSysfsPath()) != (!fan.presenceGpio())) { + if ((!fan.presenceSysfsPath()) && (!fan.presenceGpio())) { XLOG(ERR) << "either presenceSysfsPath or presenceGpio must be set"; return false; }