USB: goku_udc: Remove crude cache coherency code

This is deep architecture specific magic and does should not to exist
in a driver.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Ralf Baechle and committed by Greg Kroah-Hartman 14360ab7 0d8c7aea

-29
-29
drivers/usb/gadget/goku_udc.c
··· 297 297 298 298 /*-------------------------------------------------------------------------*/ 299 299 300 - #undef USE_KMALLOC 301 - 302 - /* many common platforms have dma-coherent caches, which means that it's 303 - * safe to use kmalloc() memory for all i/o buffers without using any 304 - * cache flushing calls. (unless you're trying to share cache lines 305 - * between dma and non-dma activities, which is a slow idea in any case.) 306 - * 307 - * other platforms need more care, with 2.6 having a moderately general 308 - * solution except for the common "buffer is smaller than a page" case. 309 - */ 310 - #if defined(CONFIG_X86) 311 - #define USE_KMALLOC 312 - 313 - #elif defined(CONFIG_MIPS) && !defined(CONFIG_DMA_NONCOHERENT) 314 - #define USE_KMALLOC 315 - 316 - #elif defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE) 317 - #define USE_KMALLOC 318 - 319 - #endif 320 - 321 300 /* allocating buffers this way eliminates dma mapping overhead, which 322 301 * on some platforms will mean eliminating a per-io buffer copy. with 323 302 * some kinds of system caches, further tweaks may still be needed. ··· 313 334 return NULL; 314 335 *dma = DMA_ADDR_INVALID; 315 336 316 - #if defined(USE_KMALLOC) 317 - retval = kmalloc(bytes, gfp_flags); 318 - if (retval) 319 - *dma = virt_to_phys(retval); 320 - #else 321 337 if (ep->dma) { 322 338 /* the main problem with this call is that it wastes memory 323 339 * on typical 1/N page allocations: it allocates 1-N pages. ··· 322 348 bytes, dma, gfp_flags); 323 349 } else 324 350 retval = kmalloc(bytes, gfp_flags); 325 - #endif 326 351 return retval; 327 352 } 328 353 ··· 329 356 goku_free_buffer(struct usb_ep *_ep, void *buf, dma_addr_t dma, unsigned bytes) 330 357 { 331 358 /* free memory into the right allocator */ 332 - #ifndef USE_KMALLOC 333 359 if (dma != DMA_ADDR_INVALID) { 334 360 struct goku_ep *ep; 335 361 ··· 337 365 return; 338 366 dma_free_coherent(&ep->dev->pdev->dev, bytes, buf, dma); 339 367 } else 340 - #endif 341 368 kfree (buf); 342 369 } 343 370