summaryrefslogtreecommitdiffstats
path: root/drivers/phy/broadcom
diff options
context:
space:
mode:
authorChunfeng Yun <chunfeng.yun@mediatek.com>2020-08-25 04:03:03 +0200
committerVinod Koul <vkoul@kernel.org>2020-09-08 06:26:10 +0200
commit01a45633009743ce120be83f6de66830f114b92f (patch)
treefe4129e78e18736dca3d3b1b5df10ff0940e1408 /drivers/phy/broadcom
parentphy: phy-bcm-ns-usb3: convert to readl_poll_timeout_atomic() (diff)
downloadlinux-01a45633009743ce120be83f6de66830f114b92f.tar.xz
linux-01a45633009743ce120be83f6de66830f114b92f.zip
phy: phy-bcm-ns2-usbdrd: convert to readl_poll_timeout_atomic()
Use readl_poll_timeout_atomic() to simplify code Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lore.kernel.org/r/1598320987-25518-2-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/phy/broadcom')
-rw-r--r--drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c b/drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c
index 527625912b78..9630ac127366 100644
--- a/drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c
+++ b/drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c
@@ -18,6 +18,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
+#include <linux/iopoll.h>
#include <linux/irq.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
@@ -87,17 +88,11 @@ static const unsigned int usb_extcon_cable[] = {
static inline int pll_lock_stat(u32 usb_reg, int reg_mask,
struct ns2_phy_driver *driver)
{
- int retry = PLL_LOCK_RETRY;
u32 val;
- do {
- udelay(1);
- val = readl(driver->icfgdrd_regs + usb_reg);
- if (val & reg_mask)
- return 0;
- } while (--retry > 0);
-
- return -EBUSY;
+ return readl_poll_timeout_atomic(driver->icfgdrd_regs + usb_reg,
+ val, (val & reg_mask), 1,
+ PLL_LOCK_RETRY);
}
static int ns2_drd_phy_init(struct phy *phy)