.. | .. |
---|
18 | 18 | #include <linux/init.h> |
---|
19 | 19 | #include <linux/interrupt.h> |
---|
20 | 20 | #include <linux/io.h> |
---|
| 21 | +#include <linux/iopoll.h> |
---|
21 | 22 | #include <linux/irq.h> |
---|
22 | 23 | #include <linux/mfd/syscon.h> |
---|
23 | 24 | #include <linux/module.h> |
---|
.. | .. |
---|
87 | 88 | static inline int pll_lock_stat(u32 usb_reg, int reg_mask, |
---|
88 | 89 | struct ns2_phy_driver *driver) |
---|
89 | 90 | { |
---|
90 | | - int retry = PLL_LOCK_RETRY; |
---|
91 | 91 | u32 val; |
---|
92 | 92 | |
---|
93 | | - do { |
---|
94 | | - udelay(1); |
---|
95 | | - val = readl(driver->icfgdrd_regs + usb_reg); |
---|
96 | | - if (val & reg_mask) |
---|
97 | | - return 0; |
---|
98 | | - } while (--retry > 0); |
---|
99 | | - |
---|
100 | | - return -EBUSY; |
---|
| 93 | + return readl_poll_timeout_atomic(driver->icfgdrd_regs + usb_reg, |
---|
| 94 | + val, (val & reg_mask), 1, |
---|
| 95 | + PLL_LOCK_RETRY); |
---|
101 | 96 | } |
---|
102 | 97 | |
---|
103 | 98 | static int ns2_drd_phy_init(struct phy *phy) |
---|
.. | .. |
---|
279 | 274 | return IRQ_HANDLED; |
---|
280 | 275 | } |
---|
281 | 276 | |
---|
282 | | -static struct phy_ops ops = { |
---|
| 277 | +static const struct phy_ops ops = { |
---|
283 | 278 | .init = ns2_drd_phy_init, |
---|
284 | 279 | .power_on = ns2_drd_phy_poweron, |
---|
285 | 280 | .power_off = ns2_drd_phy_poweroff, |
---|