From patchwork Thu Sep 14 15:51:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 112575 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp904418qgf; Thu, 14 Sep 2017 08:54:15 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5UGe1xt+eusC4giWCdmHK135r2Rb6FNjE0SfRwNj87D92pliz1UeUeF49a/rCyFc18cXCt X-Received: by 10.84.129.226 with SMTP id b89mr24417613plb.42.1505404455212; Thu, 14 Sep 2017 08:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505404455; cv=none; d=google.com; s=arc-20160816; b=PNKhyn8/799ccuXu0RJUAxB+HhbcDMTZ0I+Lns9TMsPVgJ+PFxUgKkUYosBhl3bCAL nNh42T5x58pkjnbZT8zal1PIO7l293J9FTcNbkBYkgZwRImc+0QgcwmYI3pK6rgnIp/O ECqJ2NvYFq6WIheYA9IPO78D0nG69dO5wb1CJ58mm7vA9ThKEFDT/cO3InTsA/EgsCmx VgNRLr5JsxRS/rfgzz0B8TZGz5GvD2rgFEdsnSbth/D4W/B+B7Kjjem3CbocVRffhdgh 4UAl3+adKxReRsIy8LnypzIqp7/f7bdqxo9BqP/mtD/oVFD1pKLbTBdJYaMPGSlLirzU BYDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:dkim-signature :dkim-signature:cc:from:dkim-signature:arc-authentication-results; bh=C2PwKlr1RdDUlFMsBGhPLhqp4fa5ULKuPTa4FurWZ3s=; b=r6vUATFxkPbL+2Zrqbop6nQdBYwkWQobKR3CY1CpRi6fgsz0inCdJNF9AfnQmnyv4B 0jQocm0sSsDxdob63Mr8Gph1cvFHGB5HWHTySGlAtqSXKQloW5uWePHHNvH7ifQQUI5L qtA26i0o6DbWX+O4tLDMD/vdQpA2Uw50SF6LqoPKCSUyiUOHeoYiTARMpoZLIocyGivy elHgWb3wO41UZZX4VObbEU9+7Eg3qysAXrbSjZt9iwPbVTs2zCO90GBTMgF9u1/lASza tLfyQ5h+I3INtVT0lAVRQcRxTalqo7t/J04Izu401tTCWSBSF1VdN1BYtALiHo+X1/eD zgNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=eYAMyL2B; dkim=fail header.i=@verizon.com header.s=corp header.b=d3OwdTcE; dkim=fail header.i=@verizon.com header.s=corp header.b=d3OwdTcE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si12283500plb.122.2017.09.14.08.54.14; Thu, 14 Sep 2017 08:54:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=eYAMyL2B; dkim=fail header.i=@verizon.com header.s=corp header.b=d3OwdTcE; dkim=fail header.i=@verizon.com header.s=corp header.b=d3OwdTcE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752070AbdINPyL (ORCPT + 26 others); Thu, 14 Sep 2017 11:54:11 -0400 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:16463 "EHLO omzsmtpe03.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751852AbdINPw5 (ORCPT ); Thu, 14 Sep 2017 11:52:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505404377; x=1536940377; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=UGRXJej5UXA2gm8lbgXder9Rg9701dNrLF4AcIgjO+Q=; b=eYAMyL2BBEsV2328q9a4alATtNVuJAgjDSbIwkcPxxOptf6wk6oK3Tpv IjzwA3Jpdb+7ulDkKUxFMp0StVU/pcfIfhhd4+5W45dkVXN7H/c3qJeZb PAJALdneuQggZiyqtWmxX13QxNVD6zu8kKi4xjbyJ5aF83QLLiXlvzH0M M=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe03.verizonbusiness.com with ESMTP; 14 Sep 2017 15:52:56 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Linus Walleij , Mark Brown , "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Sep 2017 15:52:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505404368; x=1536940368; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=UGRXJej5UXA2gm8lbgXder9Rg9701dNrLF4AcIgjO+Q=; b=d3OwdTcEBVko/QQALqcNbUtydaUnp9ZVeMFazFRxv/o4Pdc+JsgoShNU TomGvBTvASaaV5YwG93LcoZLD2Tl7SzccAbgqkYXPQI6Wz81TgGSjENY6 aQpvQ8IkkDqISLDpFugzI69HWZr7hL1c8cEI9mw6fc/qSib3Kmx1k4U7G g=; Received: from discovery.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.25]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Sep 2017 11:52:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505404368; x=1536940368; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=UGRXJej5UXA2gm8lbgXder9Rg9701dNrLF4AcIgjO+Q=; b=d3OwdTcEBVko/QQALqcNbUtydaUnp9ZVeMFazFRxv/o4Pdc+JsgoShNU TomGvBTvASaaV5YwG93LcoZLD2Tl7SzccAbgqkYXPQI6Wz81TgGSjENY6 aQpvQ8IkkDqISLDpFugzI69HWZr7hL1c8cEI9mw6fc/qSib3Kmx1k4U7G g=; X-Host: discovery.odc.vzwcorp.com Received: from casac1exh002.uswin.ad.vzwcorp.com ([10.11.218.44]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 14 Sep 2017 15:52:47 +0000 Received: from scwexch12apd.uswin.ad.vzwcorp.com (153.114.130.31) by CASAC1EXH002.uswin.ad.vzwcorp.com (10.11.218.44) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 14 Sep 2017 08:52:26 -0700 Received: from OMZP1LUMXCA15.uswin.ad.vzwcorp.com (144.8.22.190) by scwexch12apd.uswin.ad.vzwcorp.com (153.114.130.31) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 14 Sep 2017 08:52:26 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA15.uswin.ad.vzwcorp.com (144.8.22.190) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 14 Sep 2017 10:52:03 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Thu, 14 Sep 2017 10:52:03 -0500 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH for 4.9 46/59] ASoC: dapm: handle probe deferrals Thread-Topic: [PATCH for 4.9 46/59] ASoC: dapm: handle probe deferrals Thread-Index: AQHTLXFNc+1QGvd2FEmNlw4HQEtFiQ== Date: Thu, 14 Sep 2017 15:51:18 +0000 Message-ID: <20170914155051.8289-46-alexander.levin@verizon.com> References: <20170914155051.8289-1-alexander.levin@verizon.com> In-Reply-To: <20170914155051.8289-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit 37e1df8c95e2c8a57c77eafc097648f6e40a60ff ] This starts to handle probe deferrals on regulators and clocks on the ASoC DAPM. I came to this patch after audio stopped working on Ux500 ages ago and I finally looked into it to see what is wrong. I had messages like this in the console since a while back: ab8500-codec.0: ASoC: Failed to request audioclk: -517 ab8500-codec.0: ASoC: Failed to create DAPM control audioclk ab8500-codec.0: Failed to create new controls -12 snd-soc-mop500.0: ASoC: failed to instantiate card -12 snd-soc-mop500.0: Error: snd_soc_register_card failed (-12)! snd-soc-mop500: probe of snd-soc-mop500.0 failed with error -12 Apparently because the widget table for the codec looks like this (sound/soc/codecs/ab8500-codec.c): static const struct snd_soc_dapm_widget ab8500_dapm_widgets[] = { /* Clocks */ SND_SOC_DAPM_CLOCK_SUPPLY("audioclk"), /* Regulators */ SND_SOC_DAPM_REGULATOR_SUPPLY("V-AUD", 0, 0), SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC1", 0, 0), SND_SOC_DAPM_REGULATOR_SUPPLY("V-AMIC2", 0, 0), SND_SOC_DAPM_REGULATOR_SUPPLY("V-DMIC", 0, 0), So when we call snd_soc_register_codec() and any of these widgets get a deferred probe we do not get an -EPROBE_DEFER (-517) back as we should and instead we just fail. Apparently the code assumes that clocks and regulators must be available at this point and not defer. After this patch it rather looks like this: ab8500-codec.0: Failed to create new controls -517 snd-soc-mop500.0: ASoC: failed to instantiate card -517 snd-soc-mop500.0: Error: snd_soc_register_card failed (-517)! (...) abx500-clk.0: registered clocks for ab850x snd-soc-mop500.0: ab8500-codec-dai.0 <-> ux500-msp-i2s.1 mapping ok snd-soc-mop500.0: ab8500-codec-dai.1 <-> ux500-msp-i2s.3 mapping ok I'm pretty happy about the patch as it it, but I'm a bit uncertain on how to proceed: there are a lot of users of the external functions snd_soc_dapm_new_control() (111 sites) and that will now return an occassional error pointer, which is not handled in the calling sites. I want an indication from the maintainers whether I should just go in and augment all these call sites, or if deferred probe is frowned upon when it leads to this much overhead. Signed-off-by: Linus Walleij Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-dapm.c | 42 ++++++++++++++++++++++++++++++++++++++++++ sound/soc/soc-topology.c | 9 +++++++++ 2 files changed, 51 insertions(+) -- 2.11.0 diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 3bbe32ee4630..411f7574dd0b 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -358,6 +358,10 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, snd_soc_dapm_new_control_unlocked(widget->dapm, &template); kfree(name); + if (IS_ERR(data->widget)) { + ret = PTR_ERR(data->widget); + goto err_data; + } if (!data->widget) { ret = -ENOMEM; goto err_data; @@ -392,6 +396,10 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, data->widget = snd_soc_dapm_new_control_unlocked( widget->dapm, &template); kfree(name); + if (IS_ERR(data->widget)) { + ret = PTR_ERR(data->widget); + goto err_data; + } if (!data->widget) { ret = -ENOMEM; goto err_data; @@ -3311,11 +3319,22 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); w = snd_soc_dapm_new_control_unlocked(dapm, widget); + /* Do not nag about probe deferrals */ + if (IS_ERR(w)) { + int ret = PTR_ERR(w); + + if (ret != -EPROBE_DEFER) + dev_err(dapm->dev, + "ASoC: Failed to create DAPM control %s (%d)\n", + widget->name, ret); + goto out_unlock; + } if (!w) dev_err(dapm->dev, "ASoC: Failed to create DAPM control %s\n", widget->name); +out_unlock: mutex_unlock(&dapm->card->dapm_mutex); return w; } @@ -3338,6 +3357,8 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, w->regulator = devm_regulator_get(dapm->dev, w->name); if (IS_ERR(w->regulator)) { ret = PTR_ERR(w->regulator); + if (ret == -EPROBE_DEFER) + return ERR_PTR(ret); dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n", w->name, ret); return NULL; @@ -3356,6 +3377,8 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, w->clk = devm_clk_get(dapm->dev, w->name); if (IS_ERR(w->clk)) { ret = PTR_ERR(w->clk); + if (ret == -EPROBE_DEFER) + return ERR_PTR(ret); dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n", w->name, ret); return NULL; @@ -3474,6 +3497,16 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); for (i = 0; i < num; i++) { w = snd_soc_dapm_new_control_unlocked(dapm, widget); + if (IS_ERR(w)) { + ret = PTR_ERR(w); + /* Do not nag about probe deferrals */ + if (ret == -EPROBE_DEFER) + break; + dev_err(dapm->dev, + "ASoC: Failed to create DAPM control %s (%d)\n", + widget->name, ret); + break; + } if (!w) { dev_err(dapm->dev, "ASoC: Failed to create DAPM control %s\n", @@ -3750,6 +3783,15 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card, dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name); w = snd_soc_dapm_new_control_unlocked(&card->dapm, &template); + if (IS_ERR(w)) { + ret = PTR_ERR(w); + /* Do not nag about probe deferrals */ + if (ret != -EPROBE_DEFER) + dev_err(card->dev, + "ASoC: Failed to create %s widget (%d)\n", + link_name, ret); + goto outfree_kcontrol_news; + } if (!w) { dev_err(card->dev, "ASoC: Failed to create %s widget\n", link_name); diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 6b05047a4134..8a758c994506 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1473,6 +1473,15 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, widget = snd_soc_dapm_new_control(dapm, &template); else widget = snd_soc_dapm_new_control_unlocked(dapm, &template); + if (IS_ERR(widget)) { + ret = PTR_ERR(widget); + /* Do not nag about probe deferrals */ + if (ret != -EPROBE_DEFER) + dev_err(tplg->dev, + "ASoC: failed to create widget %s controls (%d)\n", + w->name, ret); + goto hdr_err; + } if (widget == NULL) { dev_err(tplg->dev, "ASoC: failed to create widget %s controls\n", w->name); From patchwork Thu Sep 14 15:51:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 112576 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp907989qgf; Thu, 14 Sep 2017 08:57:35 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBgG72bZGcya87UPpgUDqrPk5PKwjpaPs2lxcYpDOTt5kv62woau3rj8y9TDCLTcP4pfR9g X-Received: by 10.99.47.68 with SMTP id v65mr3748683pgv.452.1505404655429; Thu, 14 Sep 2017 08:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505404655; cv=none; d=google.com; s=arc-20160816; b=MqAy/oXsFzzyD7F7bigW6ews0Vp0Un7lnEw0PPEAhdHgJGjNrGIcO60n9EOPu26Jvb nIVRpB6kG/uSmG3B/Tlzx3tIsW2RMHALuX6uK9p69A/z4qpyaku0YKlv/6bw5yxcNy8k eGukXi9LqnzR4yU7pkO7znTHnJLDS53oZ6+vbF32iALEV6OfEFo3KOLFMBVxS0zOyYdj X3csMv+OSS0g5qN/XddMGCRaxFIMFiKwJhTJ6BxYtxfjCIw8A236QjG3nLFzYEhsz9ON CXVn4bLiPmWBtxCb8t7/qciKiehcwP98YB0q3n4oTvV1qYJu8OsEJ9tyQetYBghFxirr zDAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:dkim-signature :dkim-signature:cc:from:dkim-signature:arc-authentication-results; bh=y7+wut6CO/gJZEmbYWipy6uDn6cO5fNJNMywC2PK0YY=; b=TMq1ZCLJsKcScbUyD8VD8GNvE9lZg08zjHllgy2I/91QDiQaRKJnzt6DkFJEeb8pXj JD/1IKwNpkNpzhc2DpIvnfpvlku9QQt1bpNAXm1tLhMmAkksAevttjh0vY94tRG+kDRq +i2UNRkDQbpRhcwrnoqaYYd2zsQSo73lm7NsF94NGq68Dz+w+MN1ax03d2pGdG6x6jVb LosPj52yNie+eh9zkQpLZZaqDMX3K+TZ7/cTI5pedDOpqMeaBtxMco8gOGaKCtfpKOWO /e4p5iFsLyvgvAdUKJ6fEk8xaMLAQsyrr5zH7nOL1lmRRx/9iqVkDDW0TCuYp/vDOc8v 8gYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=s0LgtvbM; dkim=fail header.i=@verizon.com header.s=corp header.b=f5bRKyzY; dkim=fail header.i=@verizon.com header.s=corp header.b=O2fsU/DS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p29si10122896pgn.596.2017.09.14.08.57.35; Thu, 14 Sep 2017 08:57:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@verizon.com header.s=corp header.b=s0LgtvbM; dkim=fail header.i=@verizon.com header.s=corp header.b=f5bRKyzY; dkim=fail header.i=@verizon.com header.s=corp header.b=O2fsU/DS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751983AbdINP4E (ORCPT + 26 others); Thu, 14 Sep 2017 11:56:04 -0400 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:55658 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbdINPwv (ORCPT ); Thu, 14 Sep 2017 11:52:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505404371; x=1536940371; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=PrNlMAuO+kGz8IvYy8grTX7fQ3JOSV9GOBKiK2/7ba4=; b=s0LgtvbMrazqr9VymQMHHtmJZjrMl82my5Ol/EGWGE9gmAzOmOTAs+nn 2h6CuqV62pUKuw7ZRVh0AYZhW8iUptPA3TfA7CoCTdkXtZZsSSQp07xxr q666sXKMIRM6144MKQ2DoVVarDE6xfwrAUGPkaVLKFn7XG2GakhkZtNGq I=; Received: from unknown (HELO fldsmtpi01.verizon.com) ([166.68.71.143]) by omzsmtpe01.verizonbusiness.com with ESMTP; 14 Sep 2017 15:52:47 +0000 From: "Levin, Alexander (Sasha Levin)" Cc: Linus Walleij , Mark Brown , "Levin, Alexander (Sasha Levin)" Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi01.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Sep 2017 15:52:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505404363; x=1536940363; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=PrNlMAuO+kGz8IvYy8grTX7fQ3JOSV9GOBKiK2/7ba4=; b=f5bRKyzYgw/yMs4DPk1Kq01D0sfHOdFrlcZztjCZcKrseYE/zhC0Bu+1 zye9GSVpkaJ4ea5P/QvLj3SOdWyH/6TQOSiGY7R8SpRFwv6wuvj4Nukwm juPxdY5ND9l2ggA2N07D37VmLpTd/Xj9OYcj9XREnkyCSesw82tq1KGi0 o=; Received: from discovery.odc.vzwcorp.com (HELO mercury.verizonwireless.com) ([10.255.240.25]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Sep 2017 11:52:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1505404362; x=1536940362; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=PrNlMAuO+kGz8IvYy8grTX7fQ3JOSV9GOBKiK2/7ba4=; b=O2fsU/DScQ4XI0HKihr6m9MrME+oqGz+v5+FxB4I3Zw6vVT81T0P1PUf nINbtjwF1Oebk+73ncDu1KbVVFyA9vBu/6nZJvTx7yURPorO3AOp5A0hS DmplorTKLd0SgW94lEuFj1dECyIKGDLNMPy2CI/yvMTgBx6QOfXLd56cI k=; X-Host: discovery.odc.vzwcorp.com Received: from casac1exh001.uswin.ad.vzwcorp.com ([10.11.218.43]) by mercury.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 14 Sep 2017 15:52:29 +0000 Received: from scwexch16apd.uswin.ad.vzwcorp.com (153.114.130.35) by CASAC1EXH001.uswin.ad.vzwcorp.com (10.11.218.43) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 14 Sep 2017 08:52:15 -0700 Received: from OMZP1LUMXCA13.uswin.ad.vzwcorp.com (144.8.22.188) by scwexch16apd.uswin.ad.vzwcorp.com (153.114.130.35) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 14 Sep 2017 08:52:14 -0700 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA13.uswin.ad.vzwcorp.com (144.8.22.188) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Thu, 14 Sep 2017 10:52:07 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Thu, 14 Sep 2017 10:52:08 -0500 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH for 4.9 53/59] ASoC: dapm: fix some pointer error handling Thread-Topic: [PATCH for 4.9 53/59] ASoC: dapm: fix some pointer error handling Thread-Index: AQHTLXFOoenTsZBztUe14y5RoAiKGQ== Date: Thu, 14 Sep 2017 15:51:19 +0000 Message-ID: <20170914155051.8289-53-alexander.levin@verizon.com> References: <20170914155051.8289-1-alexander.levin@verizon.com> In-Reply-To: <20170914155051.8289-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit 639467c8f26d834c934215e8b59129ce442475fe ] commit 66feeec9322132689d42723df2537d60f96f8e44 "RFC: ASoC: dapm: handle probe deferrals" forgot a to update some two sites where the call was used. The static codechecks quickly found them. Reported-by: Dan Carpenter Fixes: 66feeec93221 ("RFC: ASoC: dapm: handle probe deferrals") Signed-off-by: Linus Walleij Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-dapm.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.11.0 diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 411f7574dd0b..6780eba55ec2 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3843,6 +3843,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, template.name); w = snd_soc_dapm_new_control_unlocked(dapm, &template); + if (IS_ERR(w)) { + int ret = PTR_ERR(w); + + /* Do not nag about probe deferrals */ + if (ret != -EPROBE_DEFER) + dev_err(dapm->dev, + "ASoC: Failed to create %s widget (%d)\n", + dai->driver->playback.stream_name, ret); + return ret; + } if (!w) { dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", dai->driver->playback.stream_name); @@ -3862,6 +3872,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, template.name); w = snd_soc_dapm_new_control_unlocked(dapm, &template); + if (IS_ERR(w)) { + int ret = PTR_ERR(w); + + /* Do not nag about probe deferrals */ + if (ret != -EPROBE_DEFER) + dev_err(dapm->dev, + "ASoC: Failed to create %s widget (%d)\n", + dai->driver->playback.stream_name, ret); + return ret; + } if (!w) { dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", dai->driver->capture.stream_name);