Commit 6f2a7218 authored by Chunfeng Yun's avatar Chunfeng Yun Committed by Vinod Koul

phy: phy-bcm-sr-usb: convert to readl_poll_timeout_atomic()

Use readl_poll_timeout_atomic() to simplify code
Signed-off-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1598320987-25518-3-git-send-email-chunfeng.yun@mediatek.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 01a45633
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/phy/phy.h> #include <linux/phy/phy.h>
...@@ -109,19 +110,15 @@ static inline void bcm_usb_reg32_setbits(void __iomem *addr, uint32_t set) ...@@ -109,19 +110,15 @@ static inline void bcm_usb_reg32_setbits(void __iomem *addr, uint32_t set)
static int bcm_usb_pll_lock_check(void __iomem *addr, u32 bit) static int bcm_usb_pll_lock_check(void __iomem *addr, u32 bit)
{ {
int retry; u32 data;
u32 rd_data; int ret;
retry = PLL_LOCK_RETRY_COUNT;
do {
rd_data = readl(addr);
if (rd_data & bit)
return 0;
udelay(1);
} while (--retry > 0);
ret = readl_poll_timeout_atomic(addr, data, (data & bit), 1,
PLL_LOCK_RETRY_COUNT);
if (ret)
pr_err("%s: FAIL\n", __func__); pr_err("%s: FAIL\n", __func__);
return -ETIMEDOUT;
return ret;
} }
static int bcm_usb_ss_phy_init(struct bcm_usb_phy_cfg *phy_cfg) static int bcm_usb_ss_phy_init(struct bcm_usb_phy_cfg *phy_cfg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment