char: xillybus: Eliminate redundant wrappers to DMA related calls
authorEli Billauer <eli.billauer@gmail.com>
Wed, 29 Sep 2021 09:44:42 +0000 (12:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Oct 2021 14:11:11 +0000 (16:11 +0200)
commitc31bbc140b94d0e40481966d974038569051433e
tree28534d836b7fb39844b1387f3d49540543dbfc1c
parent847afd7bd5607ca974e562d7b2b8f800c4594fe6
char: xillybus: Eliminate redundant wrappers to DMA related calls

The driver was originally written with the assumption that a different
API must be used for DMA-related functions if the device is PCIe based
or if not. Since Xillybus' driver supports devices on a PCIe bus (with
xillybus_pcie) as well as connected directly to the processor (with
xillybus_of), it originally used wrapper functions that ensure that
a different API is used for each.

This patch eliminates the said wrapper functions, as all use the same
dma_* API now. This is most notable by the code deleted in xillybus_pcie.c
and xillybus_of.c.

It also eliminates the OF driver's check for a "dma-coherent" attribute
in the device's OF entry, since this is taken care of by the kernel's
implementation of dma_sync_single_for_*().

There is however still need for one wrapper function, which is merged
from xillybus_pcie.c and xillybus_of.c into xillybus_core.c: The call to
dma_map_single() is wrapped by a function that uses the Managed Device
(devres) framework, in the absence of a relevant function in the current
kernel's API.

Suggested-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Link: https://lore.kernel.org/r/20210929094442.46383-1-eli.billauer@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/xillybus/xillybus.h
drivers/char/xillybus/xillybus_core.c
drivers/char/xillybus/xillybus_of.c
drivers/char/xillybus/xillybus_pcie.c