diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-08-02 10:18:09 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-08-27 04:55:03 -0400 |
commit | 2833c47e0ecc74b300716e56810143125ad7a3f1 (patch) | |
tree | adda4f1edcfe1f7b3eff355c9577c9bcad76931d | |
parent | cc6b0f023875a67f0c2ca7211fe6859d60b14852 (diff) |
DMA: shdma: make a pointer const
Platform data shouldn't be changed at run-time, so, pointers to it should
be const.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/sh/shdma.c | 10 | ||||
-rw-r--r-- | drivers/dma/sh/shdma.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/dma/sh/shdma.c b/drivers/dma/sh/shdma.c index e507bb285fd0..3b4bee933dd7 100644 --- a/drivers/dma/sh/shdma.c +++ b/drivers/dma/sh/shdma.c | |||
@@ -177,7 +177,7 @@ static bool dmae_is_busy(struct sh_dmae_chan *sh_chan) | |||
177 | static unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan, u32 chcr) | 177 | static unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan, u32 chcr) |
178 | { | 178 | { |
179 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); | 179 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); |
180 | struct sh_dmae_pdata *pdata = shdev->pdata; | 180 | const struct sh_dmae_pdata *pdata = shdev->pdata; |
181 | int cnt = ((chcr & pdata->ts_low_mask) >> pdata->ts_low_shift) | | 181 | int cnt = ((chcr & pdata->ts_low_mask) >> pdata->ts_low_shift) | |
182 | ((chcr & pdata->ts_high_mask) >> pdata->ts_high_shift); | 182 | ((chcr & pdata->ts_high_mask) >> pdata->ts_high_shift); |
183 | 183 | ||
@@ -190,7 +190,7 @@ static unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan, u32 chcr) | |||
190 | static u32 log2size_to_chcr(struct sh_dmae_chan *sh_chan, int l2size) | 190 | static u32 log2size_to_chcr(struct sh_dmae_chan *sh_chan, int l2size) |
191 | { | 191 | { |
192 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); | 192 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); |
193 | struct sh_dmae_pdata *pdata = shdev->pdata; | 193 | const struct sh_dmae_pdata *pdata = shdev->pdata; |
194 | int i; | 194 | int i; |
195 | 195 | ||
196 | for (i = 0; i < pdata->ts_shift_num; i++) | 196 | for (i = 0; i < pdata->ts_shift_num; i++) |
@@ -250,7 +250,7 @@ static int dmae_set_chcr(struct sh_dmae_chan *sh_chan, u32 val) | |||
250 | static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val) | 250 | static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val) |
251 | { | 251 | { |
252 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); | 252 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); |
253 | struct sh_dmae_pdata *pdata = shdev->pdata; | 253 | const struct sh_dmae_pdata *pdata = shdev->pdata; |
254 | const struct sh_dmae_channel *chan_pdata = &pdata->channel[sh_chan->shdma_chan.id]; | 254 | const struct sh_dmae_channel *chan_pdata = &pdata->channel[sh_chan->shdma_chan.id]; |
255 | void __iomem *addr = shdev->dmars; | 255 | void __iomem *addr = shdev->dmars; |
256 | unsigned int shift = chan_pdata->dmars_bit; | 256 | unsigned int shift = chan_pdata->dmars_bit; |
@@ -319,7 +319,7 @@ static const struct sh_dmae_slave_config *dmae_find_slave( | |||
319 | struct sh_dmae_chan *sh_chan, int match) | 319 | struct sh_dmae_chan *sh_chan, int match) |
320 | { | 320 | { |
321 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); | 321 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); |
322 | struct sh_dmae_pdata *pdata = shdev->pdata; | 322 | const struct sh_dmae_pdata *pdata = shdev->pdata; |
323 | const struct sh_dmae_slave_config *cfg; | 323 | const struct sh_dmae_slave_config *cfg; |
324 | int i; | 324 | int i; |
325 | 325 | ||
@@ -665,7 +665,7 @@ static const struct shdma_ops sh_dmae_shdma_ops = { | |||
665 | 665 | ||
666 | static int sh_dmae_probe(struct platform_device *pdev) | 666 | static int sh_dmae_probe(struct platform_device *pdev) |
667 | { | 667 | { |
668 | struct sh_dmae_pdata *pdata = pdev->dev.platform_data; | 668 | const struct sh_dmae_pdata *pdata = pdev->dev.platform_data; |
669 | unsigned long irqflags = IRQF_DISABLED, | 669 | unsigned long irqflags = IRQF_DISABLED, |
670 | chan_flag[SH_DMAE_MAX_CHANNELS] = {}; | 670 | chan_flag[SH_DMAE_MAX_CHANNELS] = {}; |
671 | int errirq, chan_irq[SH_DMAE_MAX_CHANNELS]; | 671 | int errirq, chan_irq[SH_DMAE_MAX_CHANNELS]; |
diff --git a/drivers/dma/sh/shdma.h b/drivers/dma/sh/shdma.h index 06aae6ebc82b..3d9dca177860 100644 --- a/drivers/dma/sh/shdma.h +++ b/drivers/dma/sh/shdma.h | |||
@@ -36,7 +36,7 @@ struct sh_dmae_chan { | |||
36 | struct sh_dmae_device { | 36 | struct sh_dmae_device { |
37 | struct shdma_dev shdma_dev; | 37 | struct shdma_dev shdma_dev; |
38 | struct sh_dmae_chan *chan[SH_DMAE_MAX_CHANNELS]; | 38 | struct sh_dmae_chan *chan[SH_DMAE_MAX_CHANNELS]; |
39 | struct sh_dmae_pdata *pdata; | 39 | const struct sh_dmae_pdata *pdata; |
40 | struct list_head node; | 40 | struct list_head node; |
41 | void __iomem *chan_reg; | 41 | void __iomem *chan_reg; |
42 | void __iomem *dmars; | 42 | void __iomem *dmars; |