diff options
author | Chunfeng Yun <chunfeng.yun@mediatek.com> | 2020-09-21 14:13:27 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-25 16:30:05 +0200 |
commit | eeae3afba6cabef7f5ee1ea130dd8c03c3d0f532 (patch) | |
tree | 69a33daf3974c5a58a0f2ca0aefe61f2617f3bda /drivers/usb/host/pci-quirks.c | |
parent | 8f01cc875d34bfbca68eb315dec203d6cb3f9eee (diff) |
usb: pci-quirks: convert to readl_poll_timeout_atomic()
Use readl_poll_timeout_atomic() to simplify code
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1600668815-12135-3-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/pci-quirks.c')
-rw-r--r-- | drivers/usb/host/pci-quirks.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index c32b544c043a..ef08d68b9714 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -17,6 +17,7 @@ #include <linux/acpi.h> #include <linux/dmi.h> #include <linux/of.h> +#include <linux/iopoll.h> #include "pci-quirks.h" #include "xhci-ext-caps.h" @@ -1012,15 +1013,9 @@ static int handshake(void __iomem *ptr, u32 mask, u32 done, { u32 result; - do { - result = readl(ptr); - result &= mask; - if (result == done) - return 0; - udelay(delay_usec); - wait_usec -= delay_usec; - } while (wait_usec > 0); - return -ETIMEDOUT; + return readl_poll_timeout_atomic(ptr, result, + ((result & mask) == done), + delay_usec, wait_usec); } /* |