Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: qcom-ufs: Use iopoll.h readl_poll_timeout macro

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>

authored by

Marc Gonzalez and committed by
Kishon Vijay Abraham I
32fcf6fc 4f0960ba

+1 -18
+1 -18
drivers/phy/qualcomm/phy-qcom-ufs-i.h
··· 23 23 #include <linux/platform_device.h> 24 24 #include <linux/io.h> 25 25 #include <linux/delay.h> 26 - 27 - #define readl_poll_timeout(addr, val, cond, sleep_us, timeout_us) \ 28 - ({ \ 29 - ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \ 30 - might_sleep_if(timeout_us); \ 31 - for (;;) { \ 32 - (val) = readl(addr); \ 33 - if (cond) \ 34 - break; \ 35 - if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ 36 - (val) = readl(addr); \ 37 - break; \ 38 - } \ 39 - if (sleep_us) \ 40 - usleep_range(DIV_ROUND_UP(sleep_us, 4), sleep_us); \ 41 - } \ 42 - (cond) ? 0 : -ETIMEDOUT; \ 43 - }) 26 + #include <linux/iopoll.h> 44 27 45 28 #define UFS_QCOM_PHY_CAL_ENTRY(reg, val) \ 46 29 { \