ASoC: omap: mcbsp: small cleanups for the sidetone code
cover ASoC: omap: mcbsp: small cleanups for the sidetone code
Hello,
to make the code a bit nicer to look at.
This series is on top of the McBSP move changeset:
http://mailman.alsa-project.org/pipermail/alsa-devel/2012-February/049628.html
Regards,
Peter
---
Peter Ujfalusi (2):
ASoC: omap: mcbsp: Use uniform st_data pointer initialization
ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer
sound/soc/omap/mcbsp.c | 25 +++++++------------------ 1 files changed, 7 insertions(+), 18 deletions(-)
Signature · 1 line
1.7.8.4
PATCH 1/2 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.
--- sound/soc/omap/mcbsp.c | 21 +++++---------------- 1 files changed, 5 insertions(+), 16 deletions(-)
sound/soc/omap/mcbsp.c +5 -16
@@ -273,11 +273,9 @@ static void omap_st_chgain(struct omap_mcbsp *mcbsp)int omap_st_set_chgain (struct omap_mcbsp *mcbsp,int channel,s16 chgain) { -struct omap_mcbsp_st_data *st_data; +struct omap_mcbsp_st_data *st_data = mcbsp->st_data;int ret =0 ; - st_data = mcbsp->st_data; -if (!st_data)return -ENOENT ;
@@ -298,11 +296,9 @@ int omap_st_set_chgain(struct omap_mcbsp *mcbsp, int channel, s16 chgain)int omap_st_get_chgain (struct omap_mcbsp *mcbsp,int channel,s16 *chgain) { -struct omap_mcbsp_st_data *st_data; +struct omap_mcbsp_st_data *st_data = mcbsp->st_data;int ret =0 ; - st_data = mcbsp->st_data; -if (!st_data)return -ENOENT ;
@@ -337,9 +333,7 @@ static int omap_st_start(struct omap_mcbsp *mcbsp)int omap_st_enable (struct omap_mcbsp *mcbsp) { -struct omap_mcbsp_st_data *st_data; - - st_data = mcbsp->st_data; +struct omap_mcbsp_st_data *st_data = mcbsp->st_data;if (!st_data)return -ENODEV ;
@@ -368,11 +362,9 @@ static int omap_st_stop(struct omap_mcbsp *mcbsp)int omap_st_disable (struct omap_mcbsp *mcbsp) { -struct omap_mcbsp_st_data *st_data; +struct omap_mcbsp_st_data *st_data = mcbsp->st_data;int ret =0 ; - st_data = mcbsp->st_data; -if (!st_data)return -ENODEV ;
@@ -386,14 +378,11 @@ int omap_st_disable(struct omap_mcbsp *mcbsp)int omap_st_is_enabled (struct omap_mcbsp *mcbsp) { -struct omap_mcbsp_st_data *st_data; - - st_data = mcbsp->st_data; +struct omap_mcbsp_st_data *st_data = mcbsp->st_data;if (!st_data)return -ENODEV ; -return st_data->enabled; }
Signature · 1 line
1.7.8.4
Re: [PATCH 1/2] ASoC: omap: mcbsp: Use uniform st_data pointer initialization
Quoted 2 lines · Peter Ujfalusi
In this way we can save few lines, and have uniform way of initializing the
st_datain all functions.
Jarkko Nikula
Acked-byRe: [PATCH 1/2] ASoC: omap: mcbsp: Use uniform st_data pointer initialization
Quoted 5 lines · Mark Brown
Quoted 2 lines · Peter Ujfalusi
In this way we can save few lines, and have uniform way of initializing the
st_datain all functions.Acked-by Mark Brown <[email protected]>
PATCH 2/2 ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer
In reply to Peter UjfalusiThe parent functions of omap_st_start/stop also checks the validity of the st_data pointer so we do not need to do it again inside of omap_st_start/stop
--- sound/soc/omap/mcbsp.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/omap/mcbsp.c +2 -2
@@ -318,7 +318,7 @@ static int omap_st_start(struct omap_mcbsp *mcbsp) {struct omap_mcbsp_st_data *st_data = mcbsp->st_data; -if (st_data && st_data->enabled && !st_data->running) { +if (st_data->enabled && !st_data->running) {omap_st_fir_write (mcbsp, st_data->taps);omap_st_chgain (mcbsp);
@@ -350,7 +350,7 @@ static int omap_st_stop(struct omap_mcbsp *mcbsp) {struct omap_mcbsp_st_data *st_data = mcbsp->st_data; -if (st_data && st_data->running) { +if (st_data->running) {if (!mcbsp->free) {omap_st_off (mcbsp); st_data->running =0 ;
Signature · 1 line
1.7.8.4
Re: [PATCH 2/2] ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer
Quoted 2 lines · Peter Ujfalusi
The parent functions of omap_st_start/stop also checks the validity of the
st_datapointer so we do not need to do it again inside of omap_st_start/stop
Jarkko Nikula
Acked-byRe: [PATCH 2/2] ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer
Quoted 5 lines · Mark Brown
Quoted 2 lines · Peter Ujfalusi
The parent functions of omap_st_start/stop also checks the validity of the
st_datapointer so we do not need to do it again inside of omap_st_start/stopAcked-by Mark Brown <[email protected]>