* [PATCH] ASoC: Report an error for unknown adav80x formats
@ 2011-07-16 2:35 Mark Brown
2011-07-16 4:16 ` Lars-Peter Clausen
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2011-07-16 2:35 UTC (permalink / raw)
To: Lars-Peter Clausen, Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown
Not only fixes error handling but also some uninitialized variable
warnings.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/codecs/adav80x.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c
index e30fba6..300c04b 100644
--- a/sound/soc/codecs/adav80x.c
+++ b/sound/soc/codecs/adav80x.c
@@ -456,7 +456,7 @@ static int adav80x_set_capture_pcm_format(struct snd_soc_codec *codec,
val = ADAV80X_CAPTURE_WORD_LEN24;
break;
default:
- break;
+ return -EINVAL;
}
snd_soc_update_bits(codec, adav80x_port_ctrl_regs[dai->id][0],
@@ -488,7 +488,7 @@ static int adav80x_set_playback_pcm_format(struct snd_soc_codec *codec,
val = ADAV80X_PLAYBACK_MODE_RIGHT_J_24;
break;
default:
- break;
+ return -EINVAL;
}
snd_soc_update_bits(codec, adav80x_port_ctrl_regs[dai->id][1],
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: Report an error for unknown adav80x formats
2011-07-16 2:35 [PATCH] ASoC: Report an error for unknown adav80x formats Mark Brown
@ 2011-07-16 4:16 ` Lars-Peter Clausen
2011-07-16 9:17 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Lars-Peter Clausen @ 2011-07-16 4:16 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, patches, Liam Girdwood
On 07/16/2011 04:35 AM, Mark Brown wrote:
> Not only fixes error handling
Doesn't the core make sure that hw_params is only called with those formats
listed as supported formats?
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: Report an error for unknown adav80x formats
2011-07-16 4:16 ` Lars-Peter Clausen
@ 2011-07-16 9:17 ` Mark Brown
0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2011-07-16 9:17 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: alsa-devel, patches, Liam Girdwood
On Sat, Jul 16, 2011 at 06:16:44AM +0200, Lars-Peter Clausen wrote:
> On 07/16/2011 04:35 AM, Mark Brown wrote:
> > Not only fixes error handling
> Doesn't the core make sure that hw_params is only called with those formats
> listed as supported formats?
Yes, but the compiler doesn't know that - I only noticed this due to the
uninitialized variable warnings.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-16 9:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-16 2:35 [PATCH] ASoC: Report an error for unknown adav80x formats Mark Brown
2011-07-16 4:16 ` Lars-Peter Clausen
2011-07-16 9:17 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.