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

usb: host: ohci-tmio: init genalloc for local memory

In preparation for dropping the existing "coherent" dma mem declaration
APIs, replace the current dma_declare_coherent_memory() based mechanism
with the creation of a genalloc pool that will be used in the OHCI
subsystem as replacement for the DMA APIs.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Laurentiu Tudor and committed by
Christoph Hellwig
7d995329 7d9e6f5a

+5 -8
+5 -8
drivers/usb/host/ohci-tmio.c
··· 224 224 goto err_ioremap_regs; 225 225 } 226 226 227 - ret = dma_declare_coherent_memory(&dev->dev, sram->start, sram->start, 228 - resource_size(sram)); 229 - if (ret) 230 - goto err_dma_declare; 231 - 232 227 if (cell->enable) { 233 228 ret = cell->enable(dev); 234 229 if (ret) ··· 233 238 tmio_start_hc(dev); 234 239 ohci = hcd_to_ohci(hcd); 235 240 ohci_hcd_init(ohci); 241 + 242 + ret = usb_hcd_setup_local_mem(hcd, sram->start, sram->start, 243 + resource_size(sram)); 244 + if (ret < 0) 245 + goto err_enable; 236 246 237 247 ret = usb_add_hcd(hcd, irq, 0); 238 248 if (ret) ··· 254 254 if (cell->disable) 255 255 cell->disable(dev); 256 256 err_enable: 257 - dma_release_declared_memory(&dev->dev); 258 - err_dma_declare: 259 257 iounmap(hcd->regs); 260 258 err_ioremap_regs: 261 259 iounmap(tmio->ccr); ··· 274 276 tmio_stop_hc(dev); 275 277 if (cell->disable) 276 278 cell->disable(dev); 277 - dma_release_declared_memory(&dev->dev); 278 279 iounmap(hcd->regs); 279 280 iounmap(tmio->ccr); 280 281 usb_put_hcd(hcd);