usb: early: convert to readl_poll_timeout_atomic()

Use readl_poll_timeout_atomic() to simplify code

Cc: Lu Baolu <[email protected]>
Cc: Mathias Nyman <[email protected]>
Reviewed-by: Jann Horn <[email protected]>
Signed-off-by: Chunfeng Yun <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Chunfeng Yun
2020-09-25 16:29:09 +02:00
committed by Greg Kroah-Hartman
parent 0d12658dc1
commit 796eed4b23
+4 -10
View File
@@ -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)