ASoC: cs42l43: Use USEC_PER_MSEC rather than hard coding
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Thu, 25 Jan 2024 10:31:15 +0000 (10:31 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 26 Jan 2024 14:46:58 +0000 (14:46 +0000)
Use USEC_PER_MSEC rather than the hard coded value of 1000.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20240125103117.2622095-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l43-jack.c

index 67ccdc8bab6f6e31d4cf7fdf66d0cdb4c97416b6..901b9dbcf58543e9b923ff4b3f3992743c5af963 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/property.h>
 #include <linux/regmap.h>
+#include <linux/time.h>
 #include <linux/workqueue.h>
 #include <sound/control.h>
 #include <sound/jack.h>
@@ -647,7 +648,7 @@ static int cs42l43_run_load_detect(struct cs42l43_codec *priv, bool mic)
 static int cs42l43_run_type_detect(struct cs42l43_codec *priv)
 {
        struct cs42l43 *cs42l43 = priv->core;
-       int timeout_ms = ((2 * priv->detect_us) / 1000) + 200;
+       int timeout_ms = ((2 * priv->detect_us) / USEC_PER_MSEC) + 200;
        unsigned int type = 0xff;
        unsigned long time_left;