From: 黄涛 Date: Mon, 16 Jun 2014 12:54:10 +0000 (+0800) Subject: spi: rockchip: fix compilation warning X-Git-Tag: firefly_0821_release~5090 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e7bd1edd0f6f81b5ef538803001a47193cc22f1a;p=firefly-linux-kernel-4.4.55.git spi: rockchip: fix compilation warning --- diff --git a/drivers/spi/spi-rockchip-core.c b/drivers/spi/spi-rockchip-core.c index b5a41a497ffb..af4ac86d6d60 100755 --- a/drivers/spi/spi-rockchip-core.c +++ b/drivers/spi/spi-rockchip-core.c @@ -74,7 +74,6 @@ static ssize_t spi_write_proc_data(struct file *file, const char __user *buffer, { struct dw_spi *dws; char *buf; - u32 len = 0; ssize_t ret; int reg = 0,value = 0; @@ -248,7 +247,7 @@ static void flush(struct dw_spi *dws) /* Return the max entries we can fill into tx fifo */ static inline u32 tx_max(struct dw_spi *dws) { - u32 tx_left, tx_room, rxtx_gap; + u32 tx_left, tx_room; tx_left = (dws->tx_end - dws->tx) / dws->n_bytes; tx_room = dws->fifo_len - dw_readw(dws, SPIM_TXFLR); @@ -336,7 +335,6 @@ static void dw_reader(struct dw_spi *dws) static int reader_all(struct dw_spi *dws) { - u16 rxw; while (!(dw_readw(dws, SPIM_SR) & SR_RF_EMPT) && (dws->rx < dws->rx_end)) { dw_reader(dws); @@ -572,7 +570,6 @@ static void pump_transfers(unsigned long data) u32 speed = 0; u32 cr0 = 0; u16 dma_ctrl = 0; - int ret = 0; /* Get current state information */ @@ -1039,7 +1036,7 @@ int dw_spi_add_host(struct dw_spi *dws) err_queue_alloc: if (dws->dma_ops && dws->dma_ops->dma_exit) dws->dma_ops->dma_exit(dws); -err_diable_hw: +/* err_diable_hw: */ spi_enable_chip(dws, 0); free_irq(dws->irq, dws); err_free_master: @@ -1051,8 +1048,6 @@ EXPORT_SYMBOL_GPL(dw_spi_add_host); void dw_spi_remove_host(struct dw_spi *dws) { - int status = 0; - if (!dws) return; diff --git a/drivers/spi/spi-rockchip-dma.c b/drivers/spi/spi-rockchip-dma.c index 750d598f2b3e..cc0d4494b63c 100755 --- a/drivers/spi/spi-rockchip-dma.c +++ b/drivers/spi/spi-rockchip-dma.c @@ -68,7 +68,6 @@ static int mid_spi_dma_init(struct dw_spi *dws) { struct spi_dma *dw_dma = dws->dma_priv; struct spi_dma_slave *rxs, *txs; - dma_cap_mask_t mask; DBG_SPI("%s:start\n",__func__); @@ -87,10 +86,10 @@ static int mid_spi_dma_init(struct dw_spi *dws) /* 2. Init tx channel */ dws->txchan = dma_request_slave_channel(dws->parent_dev, "tx"); - if (!dws->rxchan) + if (!dws->txchan) { - dev_err(dws->parent_dev, "Failed to get RX DMA channel\n"); - goto err_exit; + dev_err(dws->parent_dev, "Failed to get TX DMA channel\n"); + goto free_rxchan; } txs = &dw_dma->dmas_tx; dws->txchan->private = txs; @@ -202,7 +201,6 @@ static int mid_spi_dma_transfer(struct dw_spi *dws, int cs_change) struct dma_async_tx_descriptor *txdesc = NULL, *rxdesc = NULL; struct dma_chan *txchan, *rxchan; struct dma_slave_config txconf, rxconf; - u16 dma_ctrl = 0; int ret = 0; enum dma_slave_buswidth width; diff --git a/drivers/spi/spi-rockchip-test.c b/drivers/spi/spi-rockchip-test.c index 562b86dc8583..19aa7a12b6b9 100755 --- a/drivers/spi/spi-rockchip-test.c +++ b/drivers/spi/spi-rockchip-test.c @@ -156,8 +156,6 @@ static struct spi_board_info *rockchip_spi_parse_dt(struct device *dev) static int rockchip_spi_test_probe(struct spi_device *spi) { int ret; - int i =0; - char txbuf[256],rxbuf[256]; int id = 0; static struct dw_spi_chip *spi_chip_data; struct spi_test_data *spi_test_data; diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index cb3b51ba5c99..6b04b8e0c2b6 100755 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -104,11 +104,9 @@ static struct rockchip_spi_info *rockchip_spi_parse_dt(struct device *dev) static int rockchip_spi_probe(struct platform_device *pdev) { struct resource *mem_res; - struct resource *res; struct rockchip_spi_driver_data *sdd; struct rockchip_spi_info *info = pdev->dev.platform_data; struct dw_spi *dws; - struct spi_master *master; int ret, irq; char clk_name[16];