Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chunfeng Yun and committed by
Greg Kroah-Hartman
eeae3afb 8f01cc87

+4 -9
+4 -9
drivers/usb/host/pci-quirks.c
··· 17 17 #include <linux/acpi.h> 18 18 #include <linux/dmi.h> 19 19 #include <linux/of.h> 20 + #include <linux/iopoll.h> 20 21 21 22 #include "pci-quirks.h" 22 23 #include "xhci-ext-caps.h" ··· 1013 1012 { 1014 1013 u32 result; 1015 1014 1016 - do { 1017 - result = readl(ptr); 1018 - result &= mask; 1019 - if (result == done) 1020 - return 0; 1021 - udelay(delay_usec); 1022 - wait_usec -= delay_usec; 1023 - } while (wait_usec > 0); 1024 - return -ETIMEDOUT; 1015 + return readl_poll_timeout_atomic(ptr, result, 1016 + ((result & mask) == done), 1017 + delay_usec, wait_usec); 1025 1018 } 1026 1019 1027 1020 /*