Received: by 10.223.176.5 with SMTP id f5csp703985wra; Fri, 9 Feb 2018 05:59:35 -0800 (PST) X-Google-Smtp-Source: AH8x227uvHpYisQgIyW1tCwKIRameuMrsnVuAOH4x3vApnLJTVHDjU8ovuUR1Y20hvokf0fwtQZB X-Received: by 2002:a17:902:581a:: with SMTP id m26-v6mr2670289pli.158.1518184775701; Fri, 09 Feb 2018 05:59:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518184775; cv=none; d=google.com; s=arc-20160816; b=JZjH9IY5wELCMbGZ9hTTCCFM3Ccu6rJZGH9xP5N+Tz0VYnk2f+DTbgqcsXus5g2T3r tHUZID0y+Kgepmk9cLBm7zNSUjtMNke9QvpFIwq6DGhs1lPik1PsN84ujmJwl7QP6fsG wzMzE8MBKljd+dD1BD9nMqceuP6OBseJwm1kyzBa2OVNXEIswNcphmomQe6X0PDBacVz rwOzISMQixL7ae6jaR1okQfghaSDSkvSNBinqnkyqXixgcQ1bjwE0ni59xS0/mox9+dH HSPJKF0x5X1EqLxw6RUJJjH5XAYmJvUdqIxv4RBXbocf8iKTQ2tlD0aXjMXW20/ECWWb Qigw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=znVcafL9Z8oMtRGLrmPgLlO5/RnExYLZf29mpLbE65A=; b=vRve8VfFy7FQjWtckWwVlp5zSlY0k9Ckoh8h3RgregkcwfoRwfiJWLfMDNxWBDRw2f lVflFm8O/T9rq1hKdzxEBtg7rL6U8Yv33N29m0GhuI4JP5nYMZnd1zHYVMFaHd+rulrG 66q+04xbAJVmNSjDKDfU6t9wE1TFYakhCPorglVdCdyrhWM+C2D8RoIwhhzzfYeMZHLx L7cCc8b+7BAZ4O+26Wul19lBhQh2yOthAiGpZMrhsVna/6HPGqnVcYgsScvdkngVwpXc 1Nfi78hbKyYGvhOBgbrri4CPmSsPmQYyMpN06DwnHst/jkjzmspST2JcwMGkGb0CQx2e zqVA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 99-v6si1607300plf.440.2018.02.09.05.59.21; Fri, 09 Feb 2018 05:59:35 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753469AbeBINom (ORCPT + 99 others); Fri, 9 Feb 2018 08:44:42 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51500 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752862AbeBINoj (ORCPT ); Fri, 9 Feb 2018 08:44:39 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 81305FEE; Fri, 9 Feb 2018 13:44:38 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Scheel , Mark Brown , thongsyho , Nhan Nguyen Subject: [PATCH 4.9 87/92] ASoC: simple-card: Fix misleading error message Date: Fri, 9 Feb 2018 14:39:56 +0100 Message-Id: <20180209133937.367621168@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133931.211869118@linuxfoundation.org> References: <20180209133931.211869118@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julian Scheel commit 7ac45d1635a4cd2e99a4b11903d4a2815ca1b27b upstream. In case cpu could not be found the error message would always refer to /codec/ not being found in DT. Fix this by catching the cpu node not found case explicitly. Signed-off-by: Julian Scheel Signed-off-by: Mark Brown Signed-off-by: thongsyho Signed-off-by: Nhan Nguyen Signed-off-by: Greg Kroah-Hartman --- sound/soc/generic/simple-card.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -232,13 +232,19 @@ static int asoc_simple_card_dai_link_of( snprintf(prop, sizeof(prop), "%scpu", prefix); cpu = of_get_child_by_name(node, prop); + if (!cpu) { + ret = -EINVAL; + dev_err(dev, "%s: Can't find %s DT node\n", __func__, prop); + goto dai_link_of_err; + } + snprintf(prop, sizeof(prop), "%splat", prefix); plat = of_get_child_by_name(node, prop); snprintf(prop, sizeof(prop), "%scodec", prefix); codec = of_get_child_by_name(node, prop); - if (!cpu || !codec) { + if (!codec) { ret = -EINVAL; dev_err(dev, "%s: Can't find %s DT node\n", __func__, prop); goto dai_link_of_err;