[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1600668815-12135-3-git-send-email-chunfeng.yun@mediatek.com>
Date: Mon, 21 Sep 2020 14:13:27 +0800
From: Chunfeng Yun <chunfeng.yun@...iatek.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Felipe Balbi <balbi@...nel.org>
CC: Mathias Nyman <mathias.nyman@...el.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Chunfeng Yun <chunfeng.yun@...iatek.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Sumit Garg <sumit.garg@...aro.org>,
Lee Jones <lee.jones@...aro.org>, Jann Horn <jannh@...gle.com>,
Jason Yan <yanaijie@...wei.com>, Arnd Bergmann <arnd@...db.de>,
Chuhong Yuan <hslester96@...il.com>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
"Ben Dooks (Codethink)" <ben.dooks@...ethink.co.uk>,
Saurav Girepunje <saurav.girepunje@...il.com>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
Daniel Thompson <daniel.thompson@...aro.org>,
Mathias Nyman <mathias.nyman@...ux.intel.com>
Subject: [PATCH v4 03/11] usb: pci-quirks: convert to readl_poll_timeout_atomic()
Use readl_poll_timeout_atomic() to simplify code
Cc: Mathias Nyman <mathias.nyman@...ux.intel.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@...iatek.com>
---
v2~v4: no changes
---
drivers/usb/host/pci-quirks.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index b8961c0..8920566 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -16,6 +16,7 @@
#include <linux/export.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
+#include <linux/iopoll.h>
#include <soc/bcm2835/raspberrypi-firmware.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);
}
/*
--
1.9.1
Powered by blists - more mailing lists