Commit 01a45633 authored by Chunfeng Yun's avatar Chunfeng Yun Committed by Vinod Koul

phy: phy-bcm-ns2-usbdrd: 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-2-git-send-email-chunfeng.yun@mediatek.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 47da6aa7
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/mfd/syscon.h> #include <linux/mfd/syscon.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -87,17 +88,11 @@ static const unsigned int usb_extcon_cable[] = { ...@@ -87,17 +88,11 @@ static const unsigned int usb_extcon_cable[] = {
static inline int pll_lock_stat(u32 usb_reg, int reg_mask, static inline int pll_lock_stat(u32 usb_reg, int reg_mask,
struct ns2_phy_driver *driver) struct ns2_phy_driver *driver)
{ {
int retry = PLL_LOCK_RETRY;
u32 val; u32 val;
do { return readl_poll_timeout_atomic(driver->icfgdrd_regs + usb_reg,
udelay(1); val, (val & reg_mask), 1,
val = readl(driver->icfgdrd_regs + usb_reg); PLL_LOCK_RETRY);
if (val & reg_mask)
return 0;
} while (--retry > 0);
return -EBUSY;
} }
static int ns2_drd_phy_init(struct phy *phy) static int ns2_drd_phy_init(struct phy *phy)
......
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