Message ID | 1343745944-18418-2-git-send-email-lee.jones@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Jul 31, 2012 at 03:45:40PM +0100, Lee Jones wrote: > If a list of widgets is provided and one of them fails to be added as > a control, the present semantics fail all subsequent widgets. A better > solution would be to only fail that widget, but pursue in attempting > to add the rest of the list. To reiterate, this is in *no* way urgent or even a bug fix. > dev_err(dapm->dev, > "ASoC: Failed to create DAPM control %s\n", > widget->name); > - ret = -ENOMEM; > - break; Indeed, removing the error return is a regression.
On 31/07/12 15:56, Mark Brown wrote: > On Tue, Jul 31, 2012 at 03:45:40PM +0100, Lee Jones wrote: >> If a list of widgets is provided and one of them fails to be added as >> a control, the present semantics fail all subsequent widgets. A better >> solution would be to only fail that widget, but pursue in attempting >> to add the rest of the list. > > To reiterate, this is in *no* way urgent or even a bug fix. It fixes sound in our driver. Without this the card failes to instantiate. >> dev_err(dapm->dev, >> "ASoC: Failed to create DAPM control %s\n", >> widget->name); >> - ret = -ENOMEM; >> - break; > > Indeed, removing the error return is a regression. Isn't the return code incorrect? There are a multitude of reasons why snd_soc_dapm_new_control() would fail. No-memory is just one of them, so why do we force this probable lie?
On Tue, Jul 31, 2012 at 04:09:08PM +0100, Lee Jones wrote: > On 31/07/12 15:56, Mark Brown wrote: > >To reiterate, this is in *no* way urgent or even a bug fix. > It fixes sound in our driver. > Without this the card failes to instantiate. You're kidding, right? Fix the actual error. > Isn't the return code incorrect? There are a multitude of reasons > why snd_soc_dapm_new_control() would fail. No-memory is just one of > them, so why do we force this probable lie? I don't think anyone actually cares what the error code is, feel free to pick another random number.
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index eded657..7d9c154 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3095,8 +3095,6 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, dev_err(dapm->dev, "ASoC: Failed to create DAPM control %s\n", widget->name); - ret = -ENOMEM; - break; } widget++; }
If a list of widgets is provided and one of them fails to be added as a control, the present semantics fail all subsequent widgets. A better solution would be to only fail that widget, but pursue in attempting to add the rest of the list. Signed-off-by: Lee Jones <lee.jones@linaro.org> --- sound/soc/soc-dapm.c | 2 -- 1 file changed, 2 deletions(-)