OSDN Git Service

media: em28xx: don't use coherent buffer for DMA transfers
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 27 Feb 2018 11:08:09 +0000 (06:08 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 6 Mar 2018 09:41:34 +0000 (04:41 -0500)
commitd571b592c6206d33731f41aa710fa0f69ac8611b
tree1f8d58cc2b9ec49cb02639c2b5372dbfe8c33652
parent94448e21cf08b10f7dc7acdaca387594370396b0
media: em28xx: don't use coherent buffer for DMA transfers

While coherent memory is cheap on x86, it may cause performance
impacts on other archs. As we don't have any good reason to
use it, let's change the logic by allocating memory via kmalloc()
and letting the USB core to do the DMA mapping and memory free
for us.

While here, also fixes an issue that it was not de-allocating
memories if something gets wrong during memory block
allocation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/em28xx/em28xx-core.c
drivers/media/usb/em28xx/em28xx.h