[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1600668815-12135-1-git-send-email-chunfeng.yun@mediatek.com>
Date: Mon, 21 Sep 2020 14:13:25 +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>,
Lu Baolu <baolu.lu@...ux.intel.com>,
Mathias Nyman <mathias.nyman@...ux.intel.com>
Subject: [PATCH v4 01/11] usb: early: convert to readl_poll_timeout_atomic()
Use readl_poll_timeout_atomic() to simplify code
Cc: Lu Baolu <baolu.lu@...ux.intel.com>
Cc: Mathias Nyman <mathias.nyman@...ux.intel.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@...iatek.com>
Reviewed-by: Jann Horn <jannh@...gle.com>
---
v4: add reviewed-by Jann
v2~v3: no changes
---
drivers/usb/early/xhci-dbc.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
index c050776..be4ecba 100644
--- 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)
--
1.9.1
Powered by blists - more mailing lists