diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-02-23 08:38:37 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@ti.com> | 2012-03-12 09:34:23 -0400 |
commit | e2002ab35ff7f9111081824667ce331b2c33923c (patch) | |
tree | 94122c364bb8849b64c37b979077594171bdd48e /sound/soc/omap | |
parent | b8fb4907a74dbcbd0b21e02380d58e422bd4a1fe (diff) |
ASoC: omap: mcbsp: Use uniform st_data pointer initialization
In this way we can save few lines, and have uniform way of initializing the
st_data in all functions.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/omap')
-rw-r--r-- | sound/soc/omap/mcbsp.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c index fe4734e0c18c..79f6da6381af 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c | |||
@@ -273,11 +273,9 @@ static void omap_st_chgain(struct omap_mcbsp *mcbsp) | |||
273 | 273 | ||
274 | int omap_st_set_chgain(struct omap_mcbsp *mcbsp, int channel, s16 chgain) | 274 | int omap_st_set_chgain(struct omap_mcbsp *mcbsp, int channel, s16 chgain) |
275 | { | 275 | { |
276 | struct omap_mcbsp_st_data *st_data; | 276 | struct omap_mcbsp_st_data *st_data = mcbsp->st_data; |
277 | int ret = 0; | 277 | int ret = 0; |
278 | 278 | ||
279 | st_data = mcbsp->st_data; | ||
280 | |||
281 | if (!st_data) | 279 | if (!st_data) |
282 | return -ENOENT; | 280 | return -ENOENT; |
283 | 281 | ||
@@ -298,11 +296,9 @@ int omap_st_set_chgain(struct omap_mcbsp *mcbsp, int channel, s16 chgain) | |||
298 | 296 | ||
299 | int omap_st_get_chgain(struct omap_mcbsp *mcbsp, int channel, s16 *chgain) | 297 | int omap_st_get_chgain(struct omap_mcbsp *mcbsp, int channel, s16 *chgain) |
300 | { | 298 | { |
301 | struct omap_mcbsp_st_data *st_data; | 299 | struct omap_mcbsp_st_data *st_data = mcbsp->st_data; |
302 | int ret = 0; | 300 | int ret = 0; |
303 | 301 | ||
304 | st_data = mcbsp->st_data; | ||
305 | |||
306 | if (!st_data) | 302 | if (!st_data) |
307 | return -ENOENT; | 303 | return -ENOENT; |
308 | 304 | ||
@@ -337,9 +333,7 @@ static int omap_st_start(struct omap_mcbsp *mcbsp) | |||
337 | 333 | ||
338 | int omap_st_enable(struct omap_mcbsp *mcbsp) | 334 | int omap_st_enable(struct omap_mcbsp *mcbsp) |
339 | { | 335 | { |
340 | struct omap_mcbsp_st_data *st_data; | 336 | struct omap_mcbsp_st_data *st_data = mcbsp->st_data; |
341 | |||
342 | st_data = mcbsp->st_data; | ||
343 | 337 | ||
344 | if (!st_data) | 338 | if (!st_data) |
345 | return -ENODEV; | 339 | return -ENODEV; |
@@ -368,11 +362,9 @@ static int omap_st_stop(struct omap_mcbsp *mcbsp) | |||
368 | 362 | ||
369 | int omap_st_disable(struct omap_mcbsp *mcbsp) | 363 | int omap_st_disable(struct omap_mcbsp *mcbsp) |
370 | { | 364 | { |
371 | struct omap_mcbsp_st_data *st_data; | 365 | struct omap_mcbsp_st_data *st_data = mcbsp->st_data; |
372 | int ret = 0; | 366 | int ret = 0; |
373 | 367 | ||
374 | st_data = mcbsp->st_data; | ||
375 | |||
376 | if (!st_data) | 368 | if (!st_data) |
377 | return -ENODEV; | 369 | return -ENODEV; |
378 | 370 | ||
@@ -386,14 +378,11 @@ int omap_st_disable(struct omap_mcbsp *mcbsp) | |||
386 | 378 | ||
387 | int omap_st_is_enabled(struct omap_mcbsp *mcbsp) | 379 | int omap_st_is_enabled(struct omap_mcbsp *mcbsp) |
388 | { | 380 | { |
389 | struct omap_mcbsp_st_data *st_data; | 381 | struct omap_mcbsp_st_data *st_data = mcbsp->st_data; |
390 | |||
391 | st_data = mcbsp->st_data; | ||
392 | 382 | ||
393 | if (!st_data) | 383 | if (!st_data) |
394 | return -ENODEV; | 384 | return -ENODEV; |
395 | 385 | ||
396 | |||
397 | return st_data->enabled; | 386 | return st_data->enabled; |
398 | } | 387 | } |
399 | 388 | ||