projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d12658
)
usb: early: convert to readl_poll_timeout_atomic()
author
Chunfeng Yun
<chunfeng.yun@mediatek.com>
Mon, 21 Sep 2020 06:13:25 +0000
(14:13 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 25 Sep 2020 14:29:09 +0000
(16:29 +0200)
Use readl_poll_timeout_atomic() to simplify code
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Reviewed-by: Jann Horn <jannh@google.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link:
https://lore.kernel.org/r/1600668815-12135-1-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/early/xhci-dbc.c
patch
|
blob
|
history
diff --git
a/drivers/usb/early/xhci-dbc.c
b/drivers/usb/early/xhci-dbc.c
index c0507767a8e34f124dbfcf297dfdf714bf5e2ace..be4ecbabdd58694aa7fee6d395bd31fe377b6fc9 100644
(file)
--- a/
drivers/usb/early/xhci-dbc.c
+++ b/
drivers/usb/early/xhci-dbc.c
@@
-14,6
+14,7
@@
#include <linux/pci_ids.h>
#include <linux/memblock.h>
#include <linux/io.h>
+#include <linux/iopoll.h>
#include <asm/pci-direct.h>
#include <asm/fixmap.h>
#include <linux/bcd.h>
@@
-135,16
+136,9
@@
static int handshake(void __iomem *ptr, u32 mask, u32 done, int wait, int delay)
{
u32 result;
- do {
- result = readl(ptr);
- result &= mask;
- if (result == done)
- return 0;
- udelay(delay);
- wait -= delay;
- } while (wait > 0);
-
- return -ETIMEDOUT;
+ return readl_poll_timeout_atomic(ptr, result,
+ ((result & mask) == done),
+ delay, wait);
}
static void __init xdbc_bios_handoff(void)