From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH 1/5] ASoC: dapm: If one widget fails, do not force all subsequent widgets to fail too Date: Tue, 31 Jul 2012 16:09:08 +0100 Message-ID: <5017F514.4030106@linaro.org> References: <1343745944-18418-1-git-send-email-lee.jones@linaro.org> <1343745944-18418-2-git-send-email-lee.jones@linaro.org> <20120731145614.GZ4468@opensource.wolfsonmicro.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Return-path: Received: from mail-ey0-f179.google.com (mail-ey0-f179.google.com [209.85.215.179]) by alsa0.perex.cz (Postfix) with ESMTP id 993D8265D29 for ; Tue, 31 Jul 2012 17:09:08 +0200 (CEST) Received: by eaaa13 with SMTP id a13so1137030eaa.38 for ; Tue, 31 Jul 2012 08:09:10 -0700 (PDT) In-Reply-To: <20120731145614.GZ4468@opensource.wolfsonmicro.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: ola.o.lilja@stericsson.com, alsa-devel@alsa-project.org, linus.walleij@stericsson.com, arnd@arndb.de, olalilja@yahoo.se, linux-kernel@vger.kernel.org, STEricsson_nomadik_linux@list.st.com, linux-arm-kernel@lists.infradead.org List-Id: alsa-devel@alsa-project.org T24gMzEvMDcvMTIgMTU6NTYsIE1hcmsgQnJvd24gd3JvdGU6Cj4gT24gVHVlLCBKdWwgMzEsIDIw MTIgYXQgMDM6NDU6NDBQTSArMDEwMCwgTGVlIEpvbmVzIHdyb3RlOgo+PiBJZiBhIGxpc3Qgb2Yg d2lkZ2V0cyBpcyBwcm92aWRlZCBhbmQgb25lIG9mIHRoZW0gZmFpbHMgdG8gYmUgYWRkZWQgYXMK Pj4gYSBjb250cm9sLCB0aGUgcHJlc2VudCBzZW1hbnRpY3MgZmFpbCBhbGwgc3Vic2VxdWVudCB3 aWRnZXRzLi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X19fX19fX19fX19fX19fX19fX19fX19fX19fCkFsc2EtZGV2ZWwgbWFpbGluZyBsaXN0CkFs c2EtZGV2ZWxAYWxzYS1wcm9qZWN0Lm9yZwpodHRwOi8vbWFpbG1hbi5hbHNhLXByb2plY3Qub3Jn L21haWxtYW4vbGlzdGluZm8vYWxzYS1kZXZlbAo= From mboxrd@z Thu Jan 1 00:00:00 1970 From: lee.jones@linaro.org (Lee Jones) Date: Tue, 31 Jul 2012 16:09:08 +0100 Subject: [PATCH 1/5] ASoC: dapm: If one widget fails, do not force all subsequent widgets to fail too In-Reply-To: <20120731145614.GZ4468@opensource.wolfsonmicro.com> References: <1343745944-18418-1-git-send-email-lee.jones@linaro.org> <1343745944-18418-2-git-send-email-lee.jones@linaro.org> <20120731145614.GZ4468@opensource.wolfsonmicro.com> Message-ID: <5017F514.4030106@linaro.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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? -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754888Ab2GaPJN (ORCPT ); Tue, 31 Jul 2012 11:09:13 -0400 Received: from mail-ee0-f46.google.com ([74.125.83.46]:55340 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753987Ab2GaPJM (ORCPT ); Tue, 31 Jul 2012 11:09:12 -0400 Message-ID: <5017F514.4030106@linaro.org> Date: Tue, 31 Jul 2012 16:09:08 +0100 From: Lee Jones User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Mark Brown CC: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, STEricsson_nomadik_linux@list.st.com, linus.walleij@stericsson.com, arnd@arndb.de, olalilja@yahoo.se, ola.o.lilja@stericsson.com, alsa-devel@alsa-project.org Subject: Re: [PATCH 1/5] ASoC: dapm: If one widget fails, do not force all subsequent widgets to fail too References: <1343745944-18418-1-git-send-email-lee.jones@linaro.org> <1343745944-18418-2-git-send-email-lee.jones@linaro.org> <20120731145614.GZ4468@opensource.wolfsonmicro.com> In-Reply-To: <20120731145614.GZ4468@opensource.wolfsonmicro.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog