diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2012-07-05 06:29:37 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-07-20 01:53:44 -0400 |
commit | 341f4dc5dcecbf60f038055db177845b9af480ed (patch) | |
tree | 4431a10310f0b5f1398d7d3d3423ccf569da0e89 /drivers/dma/sh | |
parent | 7fd63ccdad72335fd820b0ce5cb8edb6ca6419ce (diff) |
dmaengine: shdma: (cosmetic) simplify a static function
dmae_find_slave() needs only the slave_id field from the slave object, no
need to pass the pointer to the object, pass the slave_id directly.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/sh')
-rw-r--r-- | drivers/dma/sh/shdma.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/dma/sh/shdma.c b/drivers/dma/sh/shdma.c index c393b354e2b3..f06906f281ac 100644 --- a/drivers/dma/sh/shdma.c +++ b/drivers/dma/sh/shdma.c | |||
@@ -304,18 +304,18 @@ static void sh_dmae_setup_xfer(struct shdma_chan *schan, | |||
304 | } | 304 | } |
305 | 305 | ||
306 | static const struct sh_dmae_slave_config *dmae_find_slave( | 306 | static const struct sh_dmae_slave_config *dmae_find_slave( |
307 | struct sh_dmae_chan *sh_chan, struct sh_dmae_slave *slave) | 307 | struct sh_dmae_chan *sh_chan, unsigned int slave_id) |
308 | { | 308 | { |
309 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); | 309 | struct sh_dmae_device *shdev = to_sh_dev(sh_chan); |
310 | struct sh_dmae_pdata *pdata = shdev->pdata; | 310 | struct sh_dmae_pdata *pdata = shdev->pdata; |
311 | const struct sh_dmae_slave_config *cfg; | 311 | const struct sh_dmae_slave_config *cfg; |
312 | int i; | 312 | int i; |
313 | 313 | ||
314 | if (slave->shdma_slave.slave_id >= SH_DMA_SLAVE_NUMBER) | 314 | if (slave_id >= SH_DMA_SLAVE_NUMBER) |
315 | return NULL; | 315 | return NULL; |
316 | 316 | ||
317 | for (i = 0, cfg = pdata->slave; i < pdata->slave_num; i++, cfg++) | 317 | for (i = 0, cfg = pdata->slave; i < pdata->slave_num; i++, cfg++) |
318 | if (cfg->slave_id == slave->shdma_slave.slave_id) | 318 | if (cfg->slave_id == slave_id) |
319 | return cfg; | 319 | return cfg; |
320 | 320 | ||
321 | return NULL; | 321 | return NULL; |
@@ -328,7 +328,7 @@ static int sh_dmae_set_slave(struct shdma_chan *schan, | |||
328 | shdma_chan); | 328 | shdma_chan); |
329 | struct sh_dmae_slave *slave = container_of(sslave, struct sh_dmae_slave, | 329 | struct sh_dmae_slave *slave = container_of(sslave, struct sh_dmae_slave, |
330 | shdma_slave); | 330 | shdma_slave); |
331 | const struct sh_dmae_slave_config *cfg = dmae_find_slave(sh_chan, slave); | 331 | const struct sh_dmae_slave_config *cfg = dmae_find_slave(sh_chan, sslave->slave_id); |
332 | if (!cfg) | 332 | if (!cfg) |
333 | return -ENODEV; | 333 | return -ENODEV; |
334 | 334 | ||