[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260115165718.36809-1-vinithamvijayan723@gmail.com>
Date: Thu, 15 Jan 2026 22:27:18 +0530
From: Vinitha Vijayan <vinithamvijayan723@...il.com>
To: andrew@...n.ch
Cc: netdev@...r.kernel.org,
kuba@...nel.org,
davem@...emloft.net,
pabeni@...hat.com,
linux-arm-msm@...r.kernel.org,
Vinitha Vijayan <vinithamvijayan723@...il.com>
Subject: [PATCH] net: phy: qcom: replace CDT poll magic numbers with named constants
Replace hard-coded poll interval and timeout values in
at803x_cdt_wait_for_completion() with named macros.
This improves readability and documents the timing assumptions
used by the cable diagnostic test without changing behavior.
Signed-off-by: Vinitha Vijayan <vinithamvijayan723@...il.com>
---
drivers/net/phy/qcom/qcom-phy-lib.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/qcom/qcom-phy-lib.c b/drivers/net/phy/qcom/qcom-phy-lib.c
index 965c2bb99a9b..cc4c6b254c62 100644
--- a/drivers/net/phy/qcom/qcom-phy-lib.c
+++ b/drivers/net/phy/qcom/qcom-phy-lib.c
@@ -9,6 +9,9 @@
#include "qcom.h"
+#define AT803X_CDT_POLL_INTERVAL_US 30000
+#define AT803X_CDT_TIMEOUT_US 100000
+
MODULE_DESCRIPTION("Qualcomm PHY driver Common Functions");
MODULE_AUTHOR("Matus Ujhelyi");
MODULE_AUTHOR("Christian Marangi <ansuelsmth@...il.com>");
@@ -484,7 +487,9 @@ int at803x_cdt_wait_for_completion(struct phy_device *phydev,
/* One test run takes about 25ms */
ret = phy_read_poll_timeout(phydev, AT803X_CDT, val,
!(val & cdt_en),
- 30000, 100000, true);
+ AT803X_CDT_POLL_INTERVAL_US,
+ AT803X_CDT_TIMEOUT_US,
+ true);
return ret < 0 ? ret : 0;
}
--
2.50.1
Powered by blists - more mailing lists