Skip to content

Commit

Permalink
spi/s3c64xx: use correct dma_transfer_direction type
Browse files Browse the repository at this point in the history
There is a subtle difference between dma_transfer_direction and
dma_data_direction: the former is used by the dmaengine framework,
while the latter is used by the dma-mapping API. Although the
purpose is comparable, the actual values are different and must
not be mixed. In this case, the driver just wants to use
dma_transfer_direction.

Without this patch, building s3c6400_defconfig results in:

drivers/spi/spi-s3c64xx.c: In function 's3c64xx_spi_dmacb':
drivers/spi/spi-s3c64xx.c:239:21: warning: comparison between
	'enum dma_data_direction' and 'enum dma_transfer_direction' [-Wenum-compare]

As pointed out by Kukjin Kim, this also changes the use of constants
from DMA_FROM_DEVICE/DMA_TO_DEVICE to DMA_DEV_TO_MEM/DMA_MEM_TO_DEV.

Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Kukjin Kim <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
  • Loading branch information
arndb committed Oct 17, 2012
1 parent fdc858a commit c10356b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/spi/spi-s3c64xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

struct s3c64xx_spi_dma_data {
unsigned ch;
enum dma_data_direction direction;
enum dma_transfer_direction direction;
enum dma_ch dmach;
struct property *dma_prop;
};
Expand Down Expand Up @@ -1065,11 +1065,11 @@ static int __devinit s3c64xx_spi_get_dmares(

if (tx) {
dma_data = &sdd->tx_dma;
dma_data->direction = DMA_TO_DEVICE;
dma_data->direction = DMA_MEM_TO_DEV;
chan_str = "tx";
} else {
dma_data = &sdd->rx_dma;
dma_data->direction = DMA_FROM_DEVICE;
dma_data->direction = DMA_DEV_TO_MEM;
chan_str = "rx";
}

Expand Down

0 comments on commit c10356b

Please sign in to comment.