Skip to content

Commit 5990e5d

Browse files
andy-shevgregkh
authored andcommitted
xhci: replace custom implementation of readq / writeq
The readq() and writeq() helpers are available in the asm-generic/io-64-nonatomic-hi-lo.h and asm-generic/io-64-nonatomic-lo-hi.h headers. Replace custom implementation by the generic helpers. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c840d6c commit 5990e5d

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/usb/host/xhci.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include <linux/kernel.h>
3030
#include <linux/usb/hcd.h>
3131

32+
#include <asm-generic/io-64-nonatomic-lo-hi.h>
33+
3234
/* Code sharing between pci-quirks and xhci hcd */
3335
#include "xhci-ext-caps.h"
3436
#include "pci-quirks.h"
@@ -1707,20 +1709,12 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci)
17071709
static inline u64 xhci_read_64(const struct xhci_hcd *xhci,
17081710
__le64 __iomem *regs)
17091711
{
1710-
__u32 __iomem *ptr = (__u32 __iomem *) regs;
1711-
u64 val_lo = readl(ptr);
1712-
u64 val_hi = readl(ptr + 1);
1713-
return val_lo + (val_hi << 32);
1712+
return lo_hi_readq(regs);
17141713
}
17151714
static inline void xhci_write_64(struct xhci_hcd *xhci,
17161715
const u64 val, __le64 __iomem *regs)
17171716
{
1718-
__u32 __iomem *ptr = (__u32 __iomem *) regs;
1719-
u32 val_lo = lower_32_bits(val);
1720-
u32 val_hi = upper_32_bits(val);
1721-
1722-
writel(val_lo, ptr);
1723-
writel(val_hi, ptr + 1);
1717+
lo_hi_writeq(val, regs);
17241718
}
17251719

17261720
static inline int xhci_link_trb_quirk(struct xhci_hcd *xhci)

0 commit comments

Comments
 (0)