aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/buffer.c
diff options
context:
space:
mode:
authorLaurentiu Tudor <[email protected]>2019-05-29 10:28:43 +0000
committerChristoph Hellwig <[email protected]>2019-06-03 14:00:08 +0000
commit2d7a3dc3e24f43504b1f25eae8195e600f4cce8b (patch)
tree64a85b7873d82779000de66a071ae50157a75d2d /drivers/usb/core/buffer.c
parentusb: host: ohci-tmio: init genalloc for local memory (diff)
downloadkernel-2d7a3dc3e24f43504b1f25eae8195e600f4cce8b.tar.gz
kernel-2d7a3dc3e24f43504b1f25eae8195e600f4cce8b.zip
USB: drop HCD_LOCAL_MEM flag
With the addition of the local memory allocator, the HCD_LOCAL_MEM flag can be dropped and the checks against it replaced with a check for the localmem_pool ptr being initialized. Signed-off-by: Laurentiu Tudor <[email protected]> Tested-by: Fredrik Noring <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'drivers/usb/core/buffer.c')
-rw-r--r--drivers/usb/core/buffer.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
index d2064ad7ad14..1359b78a624e 100644
--- a/drivers/usb/core/buffer.c
+++ b/drivers/usb/core/buffer.c
@@ -68,7 +68,7 @@ int hcd_buffer_create(struct usb_hcd *hcd)
if (!IS_ENABLED(CONFIG_HAS_DMA) ||
(!is_device_dma_capable(hcd->self.sysdev) &&
- !(hcd->driver->flags & HCD_LOCAL_MEM)))
+ !hcd->localmem_pool))
return 0;
for (i = 0; i < HCD_BUFFER_POOLS; i++) {
@@ -130,8 +130,7 @@ void *hcd_buffer_alloc(
/* some USB hosts just use PIO */
if (!IS_ENABLED(CONFIG_HAS_DMA) ||
- (!is_device_dma_capable(bus->sysdev) &&
- !(hcd->driver->flags & HCD_LOCAL_MEM))) {
+ !is_device_dma_capable(bus->sysdev)) {
*dma = ~(dma_addr_t) 0;
return kmalloc(size, mem_flags);
}
@@ -162,8 +161,7 @@ void hcd_buffer_free(
}
if (!IS_ENABLED(CONFIG_HAS_DMA) ||
- (!is_device_dma_capable(bus->sysdev) &&
- !(hcd->driver->flags & HCD_LOCAL_MEM))) {
+ !is_device_dma_capable(bus->sysdev)) {
kfree(addr);
return;
}