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 <laurentiu.tudor@nxp.com> Tested-by: Fredrik Noring <noring@nocrew.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
committed by
Christoph Hellwig
parent
7d99532955
commit
2d7a3dc3e2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user