spi: dw-mid: constify dw_spi_dma_ops structure
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 28 Nov 2015 14:09:38 +0000 (15:09 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 30 Nov 2015 11:34:50 +0000 (11:34 +0000)
The dw_spi_dma_ops structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw-mid.c
drivers/spi/spi-dw.h

index bb1052e748f28269b3cdde6390c6998b43b98d37..9185f6c08459842e68a6292dbae6b6884d53fcde 100644 (file)
@@ -283,7 +283,7 @@ static void mid_spi_dma_stop(struct dw_spi *dws)
        }
 }
 
-static struct dw_spi_dma_ops mid_dma_ops = {
+static const struct dw_spi_dma_ops mid_dma_ops = {
        .dma_init       = mid_spi_dma_init,
        .dma_exit       = mid_spi_dma_exit,
        .dma_setup      = mid_spi_dma_setup,
index 35589a270468d6f2dcd7f57ef0c4073cd6fe5721..61bc3cbab38d5b766554e559c011cbf3aa98fb05 100644 (file)
@@ -130,7 +130,7 @@ struct dw_spi {
        struct dma_chan         *rxchan;
        unsigned long           dma_chan_busy;
        dma_addr_t              dma_addr; /* phy address of the Data register */
-       struct dw_spi_dma_ops   *dma_ops;
+       const struct dw_spi_dma_ops *dma_ops;
        void                    *dma_tx;
        void                    *dma_rx;