phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro
authorMarc Gonzalez <marc.w.gonzalez@free.fr>
Fri, 21 Dec 2018 10:13:18 +0000 (11:13 +0100)
committerKishon Vijay Abraham I <kishon@ti.com>
Thu, 7 Feb 2019 05:40:36 +0000 (11:10 +0530)
The private copy of readl_poll_timeout is no longer needed.
Use the implementation in iopoll.h instead.

Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Andy Gross <andy.gross@linaro.org>
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/qualcomm/phy-qcom-ufs-i.h

index 681644e..f798fb6 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/delay.h>
-
-#define readl_poll_timeout(addr, val, cond, sleep_us, timeout_us) \
-({ \
-       ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
-       might_sleep_if(timeout_us); \
-       for (;;) { \
-               (val) = readl(addr); \
-               if (cond) \
-                       break; \
-               if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \
-                       (val) = readl(addr); \
-                       break; \
-               } \
-               if (sleep_us) \
-                       usleep_range(DIV_ROUND_UP(sleep_us, 4), sleep_us); \
-       } \
-       (cond) ? 0 : -ETIMEDOUT; \
-})
+#include <linux/iopoll.h>
 
 #define UFS_QCOM_PHY_CAL_ENTRY(reg, val)       \
        {                               \