mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 03:30:52 +07:00
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>
This commit is contained in:
parent
8f01cc875d
commit
eeae3afba6
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user