Skip to content

Commit 2833c47

Browse files
lyakhVinod Koul
authored andcommitted
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 <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
1 parent cc6b0f0 commit 2833c47

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/dma/sh/shdma.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static bool dmae_is_busy(struct sh_dmae_chan *sh_chan)
177177
static unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan, u32 chcr)
178178
{
179179
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;
181181
int cnt = ((chcr & pdata->ts_low_mask) >> pdata->ts_low_shift) |
182182
((chcr & pdata->ts_high_mask) >> pdata->ts_high_shift);
183183

@@ -190,7 +190,7 @@ static unsigned int calc_xmit_shift(struct sh_dmae_chan *sh_chan, u32 chcr)
190190
static u32 log2size_to_chcr(struct sh_dmae_chan *sh_chan, int l2size)
191191
{
192192
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;
194194
int i;
195195

196196
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)
250250
static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val)
251251
{
252252
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;
254254
const struct sh_dmae_channel *chan_pdata = &pdata->channel[sh_chan->shdma_chan.id];
255255
void __iomem *addr = shdev->dmars;
256256
unsigned int shift = chan_pdata->dmars_bit;
@@ -319,7 +319,7 @@ static const struct sh_dmae_slave_config *dmae_find_slave(
319319
struct sh_dmae_chan *sh_chan, int match)
320320
{
321321
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;
323323
const struct sh_dmae_slave_config *cfg;
324324
int i;
325325

@@ -665,7 +665,7 @@ static const struct shdma_ops sh_dmae_shdma_ops = {
665665

666666
static int sh_dmae_probe(struct platform_device *pdev)
667667
{
668-
struct sh_dmae_pdata *pdata = pdev->dev.platform_data;
668+
const struct sh_dmae_pdata *pdata = pdev->dev.platform_data;
669669
unsigned long irqflags = IRQF_DISABLED,
670670
chan_flag[SH_DMAE_MAX_CHANNELS] = {};
671671
int errirq, chan_irq[SH_DMAE_MAX_CHANNELS];

drivers/dma/sh/shdma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct sh_dmae_chan {
3636
struct sh_dmae_device {
3737
struct shdma_dev shdma_dev;
3838
struct sh_dmae_chan *chan[SH_DMAE_MAX_CHANNELS];
39-
struct sh_dmae_pdata *pdata;
39+
const struct sh_dmae_pdata *pdata;
4040
struct list_head node;
4141
void __iomem *chan_reg;
4242
void __iomem *dmars;

0 commit comments

Comments
 (0)