linux/drivers/spi
Nathan Chancellor a1108c7b2e
spi: spi-ep93xx: Use dma_data_direction for ep93xx_spi_dma_{finish,prepare}
Clang warns when one enumerated type is implicitly converted to another.

drivers/spi/spi-ep93xx.c:342:62: warning: implicit conversion from
enumeration type 'enum dma_transfer_direction' to different enumeration
type 'enum dma_data_direction' [-Wenum-conversion]
        nents = dma_map_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
./include/linux/dma-mapping.h:428:58: note: expanded from macro
'dma_map_sg'
#define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, 0)
                               ~~~~~~~~~~~~~~~~          ^
drivers/spi/spi-ep93xx.c:348:57: warning: implicit conversion from
enumeration type 'enum dma_transfer_direction' to different enumeration
type 'enum dma_data_direction' [-Wenum-conversion]
                dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
./include/linux/dma-mapping.h:429:62: note: expanded from macro
'dma_unmap_sg'
#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0)
                                 ~~~~~~~~~~~~~~~~~~          ^
drivers/spi/spi-ep93xx.c:377:56: warning: implicit conversion from
enumeration type 'enum dma_transfer_direction' to different enumeration
type 'enum dma_data_direction' [-Wenum-conversion]
        dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
./include/linux/dma-mapping.h:429:62: note: expanded from macro
'dma_unmap_sg'
#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0)
                                 ~~~~~~~~~~~~~~~~~~          ^
3 warnings generated.

dma_{,un}map_sg expect an enum of type dma_data_direction but this
driver uses dma_transfer_direction for everything. Convert the driver to
use dma_data_direction for these two functions.

There are two places that strictly require an enum of type
dma_transfer_direction: the direction member in struct dma_slave_config
and the direction parameter in dmaengine_prep_slave_sg. To avoid using
an explicit cast, add a simple function, ep93xx_dma_data_to_trans_dir,
to safely map between the two types because they are not 1 to 1 in
meaning.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-10-09 00:11:28 +01:00
..
internals.h spi: Add an helper to flush the message queue 2018-04-23 15:48:18 +01:00
Kconfig spi: mediatek: add spi slave for Mediatek MT2712 2018-09-28 14:29:14 +01:00
Makefile spi: mediatek: add spi slave for Mediatek MT2712 2018-09-28 14:29:14 +01:00
spi-altera.c spi: altera: Consolidate TX/RX data register access 2017-08-16 11:53:31 +01:00
spi-armada-3700.c Merge remote-tracking branches 'spi/topic/a3700', 'spi/topic/atmel', 'spi/topic/bcm53xx', 'spi/topic/davinci' and 'spi/topic/dw' into spi-next 2018-01-26 17:57:24 +00:00
spi-ath79.c spi: add flags parameter to txrx_word function pointers 2018-08-01 14:50:24 +01:00
spi-atmel.c spi: Do not print a message if spi_controller_{suspend,resume}() fails 2018-09-05 12:38:27 +01:00
spi-au1550.c
spi-axi-spi-engine.c spi: spi-axi: fix potential use-after-free after deregistration 2017-10-31 11:15:10 +00:00
spi-bcm-qspi.c Merge branch 'spi-4.17' into spi-4.18 for the merge window 2018-06-04 11:51:12 +01:00
spi-bcm-qspi.h
spi-bcm63xx-hsspi.c spi/bcm63xx-hsspi: keep pll clk enabled 2018-09-18 09:16:34 -07:00
spi-bcm63xx.c spi/bcm63xx: fix error return code in bcm63xx_spi_probe() 2017-08-08 11:36:35 +01:00
spi-bcm2835.c
spi-bcm2835aux.c spi: bcm2835aux: ensure interrupts are enabled for shared handler 2018-05-04 08:09:02 +09:00
spi-bitbang-txrx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spi-bitbang.c spi: spi-gpio: add SPI_3WIRE support 2018-08-01 14:50:28 +01:00
spi-brcmstb-qspi.c
spi-butterfly.c spi: add flags parameter to txrx_word function pointers 2018-08-01 14:50:24 +01:00
spi-cadence.c spi: cadence: Fix missing clk_disable_unprepare() on error in cnds_runtime_resume() 2018-07-11 15:34:53 +01:00
spi-cavium-octeon.c
spi-cavium-thunderx.c
spi-cavium.c
spi-cavium.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spi-clps711x.c
spi-coldfire-qspi.c
spi-davinci.c spi: spi-davinci: Don't error when SPI_CS_WORD and cs_gpio 2018-09-18 10:40:34 -07:00
spi-dln2.c
spi-dw-mid.c spi: dw: Convert to generalized SPI controller API 2018-02-12 12:04:16 +00:00
spi-dw-mmio.c spi: dw-mmio: avoid hardcoded field mask 2018-08-31 15:54:13 +01:00
spi-dw-pci.c
spi-dw.c spi: dw: support 4-16 bits per word 2018-09-06 12:09:37 +01:00
spi-dw.h spi: dw: export dw_spi_set_cs 2018-07-30 12:02:07 +01:00
spi-efm32.c
spi-ep93xx.c spi: spi-ep93xx: Use dma_data_direction for ep93xx_spi_dma_{finish,prepare} 2018-10-09 00:11:28 +01:00
spi-falcon.c spi: spi-falcon: drop check of boot select 2017-09-01 11:33:22 +01:00
spi-fsl-cpm.c
spi-fsl-cpm.h
spi-fsl-dspi.c spi: spi-fsl-dspi: Switch to SPDX identifier 2018-07-24 15:37:36 +01:00
spi-fsl-espi.c spi: Do not print a message if spi_controller_{suspend,resume}() fails 2018-09-05 12:38:27 +01:00
spi-fsl-lib.c
spi-fsl-lib.h spi: fsl-espi: separate fsl-espi from fsl-lib completely 2016-11-14 11:21:48 +00:00
spi-fsl-lpspi.c spi: lpspi: Switch to SPDX identifier 2018-05-03 10:28:08 +09:00
spi-fsl-spi.c Merge remote-tracking branches 'spi/topic/devprop', 'spi/topic/fsl', 'spi/topic/fsl-dspi', 'spi/topic/imx' and 'spi/topic/lantiq' into spi-next 2017-04-26 15:58:04 +01:00
spi-fsl-spi.h
spi-gpio.c spi: gpio: No MISO does not imply no RX 2018-09-10 12:29:58 +01:00
spi-img-spfi.c spi: img-spfi: Set device select bits for SPFI port state 2018-07-30 16:31:54 +01:00
spi-imx.c spi: imx: Use the longuest possible burst size when in dynamic_burst 2018-07-24 15:58:35 +01:00
spi-iproc-qspi.c
spi-jcore.c spi: jcore: disable ref_clk after getting its rate 2018-03-18 17:57:42 -07:00
spi-lantiq-ssc.c Merge remote-tracking branches 'spi/topic/devprop', 'spi/topic/fsl', 'spi/topic/fsl-dspi', 'spi/topic/imx' and 'spi/topic/lantiq' into spi-next 2017-04-26 15:58:04 +01:00
spi-lm70llp.c spi: add flags parameter to txrx_word function pointers 2018-08-01 14:50:24 +01:00
spi-loopback-test.c spi: loopback-test: implement testing with no CS 2017-07-26 13:08:56 +01:00
spi-lp8841-rtc.c
spi-mem.c spi: spi-mem: Fix inverted logic in op sanity check 2018-09-27 23:29:57 +01:00
spi-meson-spicc.c spi: meson-spicc: Fix error handling in meson_spicc_probe() 2018-05-02 05:59:21 +09:00
spi-meson-spifc.c
spi-mpc52xx-psc.c
spi-mpc52xx.c spi: mpc52xx: Use gpio_is_valid() 2018-04-27 12:05:39 +01:00
spi-mpc512x-psc.c
spi-mt65xx.c spi: mediatek: Don't modify spi_transfer when transfer. 2018-09-18 09:28:06 -07:00
spi-mxs.c spi: mxs: Switch to SPDX identifier 2018-05-03 10:27:43 +09:00
spi-nuc900.c
spi-oc-tiny.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
spi-omap-100k.c
spi-omap-uwire.c
spi-omap2-mcspi.c spi: omap2-mcspi: remove several redundant variables 2018-07-30 16:08:12 +01:00
spi-orion.c spi: orion: cosmetics - alias long direct_access variables 2018-09-03 15:14:18 +01:00
spi-pic32-sqi.c spi: pic32-sqi: remove unnecessary of_node_get() 2018-09-17 10:54:08 -07:00
spi-pic32.c spi: pic32: Use proper enum in dmaengine_prep_slave_rg 2018-09-20 18:11:22 -07:00
spi-pl022.c spi: pl022: Remove set but not used variable 'chip' 2018-09-07 17:03:48 +01:00
spi-ppc4xx.c spi/ppc4xx: Use kcalloc() in spi_ppc4xx_of_probe() 2017-01-17 18:34:25 +00:00
spi-pxa2xx-dma.c spi: pxa2xx: Use core message processing loop 2018-04-17 17:11:30 +01:00
spi-pxa2xx-pci.c spi: pca2xx-pci: Allow MSI 2017-01-23 18:09:37 +00:00
spi-pxa2xx.c spi: pxa2xx: Rewrite switch code block in interrupt_transfer 2018-10-04 15:33:55 +01:00
spi-pxa2xx.h spi: pxa2xx: Allow 64-bit DMA 2018-04-24 16:10:12 +01:00
spi-qup.c spi: qup: fix 64-bit build warning 2017-08-10 15:50:23 +01:00
spi-rb4xx.c
spi-rockchip.c spi: rockchip: configure CTRLR1 according to size and data frame 2017-08-16 11:58:23 +01:00
spi-rspi.c spi: use SPDX identifier for Renesas drivers 2018-08-28 20:32:00 +01:00
spi-s3c24xx-fiq.h
spi-s3c24xx-fiq.S
spi-s3c24xx.c
spi-s3c64xx.c spi: spi-s3c64xx: Fix system resume support 2018-05-17 13:27:08 +09:00
spi-sc18is602.c spi: sc18is602: Add OF device ID table 2017-02-22 10:50:09 -08:00
spi-sh-hspi.c spi: use SPDX identifier for Renesas drivers 2018-08-28 20:32:00 +01:00
spi-sh-msiof.c spi: use SPDX identifier for Renesas drivers 2018-08-28 20:32:00 +01:00
spi-sh-sci.c spi: add flags parameter to txrx_word function pointers 2018-08-01 14:50:24 +01:00
spi-sh.c spi: use SPDX identifier for Renesas drivers 2018-08-28 20:32:00 +01:00
spi-sirf.c spi: sirf: account for const type of of_device_id.data 2018-01-03 11:38:46 +00:00
spi-slave-mt27xx.c spi: mediatek: add spi slave for Mediatek MT2712 2018-09-28 14:29:14 +01:00
spi-slave-system-control.c spi: slave: Fix missing break in switch 2018-10-03 16:23:10 +01:00
spi-slave-time.c spi: slave: Add SPI slave handler reporting uptime at previous message 2017-05-26 13:12:04 +01:00
spi-sprd-adi.c spi: sprd: Change to use devm_hwspin_lock_request_specific() 2018-06-26 13:52:27 -07:00
spi-sprd.c spi: sprd: don't mark remove function as __exit 2018-09-27 23:26:43 +01:00
spi-st-ssc4.c spi: st-ssc4: whitespace cleanup 2017-05-26 12:41:07 +01:00
spi-stm32.c spi: stm32: Fix error handling in stm32_spi_probe() 2018-04-17 11:46:23 +01:00
spi-sun4i.c spi: sun4i: disable clocks in the remove function 2017-12-07 11:59:15 +00:00
spi-sun6i.c spi: sun6i: disable/unprepare clocks on remove 2017-12-07 17:45:17 +00:00
spi-tegra20-sflash.c spi: tegra20-sflash: explicitly request exclusive reset control 2017-07-19 17:06:31 +01:00
spi-tegra20-slink.c spi: tegra20-slink: use true and false for boolean values 2018-03-06 14:20:37 +00:00
spi-tegra114.c spi: tegra114: correct register name in definition 2017-10-09 10:16:38 +01:00
spi-test.h spi: loopback-test: add elapsed time check 2017-03-17 21:54:08 +00:00
spi-ti-qspi.c spi: ti-qspi: Make sure res_mmap != NULL before dereferencing it 2018-05-17 13:36:00 +09:00
spi-tle62x0.c
spi-topcliff-pch.c spi/topcliff-pch: Delete an error message for a failed memory allocation in pch_spi_set_tx() 2017-01-17 18:38:02 +00:00
spi-txx9.c
spi-uniphier.c spi: uniphier: remove unnecessary include headers 2018-08-02 11:08:06 +01:00
spi-xcomm.c
spi-xilinx.c spi: xilinx: Add support for xlnx,axi-quad-spi-1.00.a 2017-11-27 16:31:20 +00:00
spi-xlp.c spi: xlp: fix error return code in xlp_spi_probe() 2017-08-08 11:36:07 +01:00
spi-xtensa-xtfpga.c spi: add flags parameter to txrx_word function pointers 2018-08-01 14:50:24 +01:00
spi-zynqmp-gqspi.c spi: simplify getting .drvdata 2018-04-20 17:53:20 +01:00
spi.c spi: switch to SPDX license identifier 2018-09-27 23:30:48 +01:00
spidev.c spidev: Enable the Liebherr's BK4 board to work with spidev driver 2018-10-08 14:06:31 +01:00