From patchwork Fri Oct 13 01:37:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 115686 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp176991qgn; Thu, 12 Oct 2017 18:37:51 -0700 (PDT) X-Google-Smtp-Source: AOwi7QD1OyA+fJUIsYKlED0GheRMDYNyrBsRRBeK7yXsWaC++CsYtG1fmoYPqEXBbJ0ogjn1TS8t X-Received: by 10.223.182.19 with SMTP id f19mr3858525wre.166.1507858671817; Thu, 12 Oct 2017 18:37:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507858671; cv=none; d=google.com; s=arc-20160816; b=fxaiQpGtDI0L6KFrhXxM62Zsg/bcN8+zYZy2t/40KJhajasSGxMbKtzachpt0iKsNi FyfTVfGxKsQns+wvtc4g2zy4FLC2Yg/JzW2cBocCUtBQFbMo3KgPTu6xWFwmBI+CFShn hXVRNC1Zh06Q6CrFmHcUYj9ltM5tJwaGPu/irM+nfqJMwk/t8OVAK5ZmufjQ18QK03G6 PpE7mXxT1zllc4hs80EGAZNwruItjo0zR9aOSpxvJYoBHZs3gPFJlY6XKeei0cUhXg1S zmc/lV3+7xDVP8ZMyC7ZtSIpk1ekkYWbgjakrmDpU9v7gnhZj1EAQApk7jqLtIlb+03w 3jtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=ohfNOKvOpGJEJC3TOC01KRJNHSrFt/f2+QEvVTmGjRc=; b=1HKznltXvdsIbbxbAed6Bk2PAk5duVj/soTnr52KV3Q6fgaLQkZcWigZvcH17Vmxgl mDHMEKOo0lQCBpNaqjwNDSMIwfJ8DlJP4YEHvnre+naG+xLL+A6Qcah7oGo0va/c8Uh6 j/PAiPGGQYJyuRRpLs8ziGc4qM0XVO7o6NUwtiTjXt6Z0kgQqGd4hWBrSD5C5ZHH85fY uQorQCYuQbdsEY3mL1hJ0X3r8AuRln6q5xQse+yBd91y9s80jyBv7fRQ9GaMoalN4MM/ LAbNACc9Aagevo9W4bO7nZ7tphp8dnUPpcVsqxnWmf6TotHDij35sDST5l7s5riz9++3 738g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=bpAcYUkW; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id x195si68495wme.232.2017.10.12.18.37.51; Thu, 12 Oct 2017 18:37:51 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=bpAcYUkW; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DF0F326762E; Fri, 13 Oct 2017 03:37:49 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id F0F1126762F; Fri, 13 Oct 2017 03:37:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_NEUTRAL autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 83C78266FAD for ; Fri, 13 Oct 2017 03:37:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=s2+8V82EHakYyvbUpsBDkTKAzqzB6BOTvvR+27BUxZA=; b=bpAcYUkWdhU9 a3vCLn5/jAA6XbT1PRUSD8X9YA7mkOlO5+ZOT3YTagh2ADC0U5+K4dWqhVZj/Ht07FKygx34t2cVc YlkqFGHsUw5drI7t1nASUQPU6R1snXA5NheRcZmT44SiRBe+O+I14wxIkvRuFPlvat/FCg/dXGsBw 54uag=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1e2ouz-0000qm-3G; Fri, 13 Oct 2017 01:37:41 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1e2ouy-0005aV-Ey; Fri, 13 Oct 2017 02:37:40 +0100 From: Mark Brown To: Axel Lin In-Reply-To: <20171013012101.17715-1-axel.lin@ingics.com> Message-Id: Date: Fri, 13 Oct 2017 02:37:40 +0100 Cc: Anish Kumar , alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood Subject: [alsa-devel] Applied "ASoC: max98925: Return proper error if revision mismatch" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: max98925: Return proper error if revision mismatch has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From d6e18b8295593d8f59e92f6634577cbacae14629 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 13 Oct 2017 09:21:01 +0800 Subject: [PATCH] ASoC: max98925: Return proper error if revision mismatch Return proper error instead of 0 if the revision does not match. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- sound/soc/codecs/max98925.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) -- 2.14.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/max98925.c b/sound/soc/codecs/max98925.c index 327eaa25c9bd..921f95fc396d 100644 --- a/sound/soc/codecs/max98925.c +++ b/sound/soc/codecs/max98925.c @@ -579,7 +579,7 @@ static int max98925_i2c_probe(struct i2c_client *i2c, ret = PTR_ERR(max98925->regmap); dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret); - goto err_out; + return ret; } if (!of_property_read_u32(i2c->dev.of_node, "vmon-slot-no", &value)) { @@ -596,16 +596,20 @@ static int max98925_i2c_probe(struct i2c_client *i2c, } max98925->i_slot = value; } - ret = regmap_read(max98925->regmap, - MAX98925_REV_VERSION, ®); - if ((ret < 0) || - ((reg != MAX98925_VERSION) && - (reg != MAX98925_VERSION1))) { - dev_err(&i2c->dev, - "device initialization error (%d 0x%02X)\n", + + ret = regmap_read(max98925->regmap, MAX98925_REV_VERSION, ®); + if (ret < 0) { + dev_err(&i2c->dev, "Read revision failed\n"); + return ret; + } + + if ((reg != MAX98925_VERSION) && (reg != MAX98925_VERSION1)) { + ret = -ENODEV; + dev_err(&i2c->dev, "Invalid revision (%d 0x%02X)\n", ret, reg); - goto err_out; + return ret; } + dev_info(&i2c->dev, "device version 0x%02X\n", reg); ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_max98925, @@ -613,7 +617,6 @@ static int max98925_i2c_probe(struct i2c_client *i2c, if (ret < 0) dev_err(&i2c->dev, "Failed to register codec: %d\n", ret); -err_out: return ret; }