Commit eeae3afb authored by Chunfeng Yun's avatar Chunfeng Yun Committed by Greg Kroah-Hartman

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: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1600668815-12135-3-git-send-email-chunfeng.yun@mediatek.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8f01cc87
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/dmi.h> #include <linux/dmi.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/iopoll.h>
#include "pci-quirks.h" #include "pci-quirks.h"
#include "xhci-ext-caps.h" #include "xhci-ext-caps.h"
...@@ -1012,15 +1013,9 @@ static int handshake(void __iomem *ptr, u32 mask, u32 done, ...@@ -1012,15 +1013,9 @@ static int handshake(void __iomem *ptr, u32 mask, u32 done,
{ {
u32 result; u32 result;
do { return readl_poll_timeout_atomic(ptr, result,
result = readl(ptr); ((result & mask) == done),
result &= mask; delay_usec, wait_usec);
if (result == done)
return 0;
udelay(delay_usec);
wait_usec -= delay_usec;
} while (wait_usec > 0);
return -ETIMEDOUT;
} }
/* /*
......
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