From patchwork Sat Nov 17 03:27:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 151396 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp113248ljp; Fri, 16 Nov 2018 19:27:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/XHxqpOib0iZwLFySNFCPMJvLMg8sLtHJJokd4bIWXj0yXDxTPqBGkQgLsc9cKlh42ZNgnu X-Received: by 2002:a5d:4286:: with SMTP id k6mr7231890wrq.225.1542425275218; Fri, 16 Nov 2018 19:27:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542425275; cv=none; d=google.com; s=arc-20160816; b=jrEoPUFA/eJ8Kf/jbnYRUauCva7foHAtFrJqrGP7uQS3oDNYRoEhVDlflteYtX3W8o zDTCj+thlqpFu5OD+GE4yA+41sTEgvtpf4v11CbMjxV55Qx4qAf6/CGzzwjxr3+MyH+k xGBahhr1t6DrQ49bUbb2oE9h1nJ2kqRqQpcQaiiFR79YfQ6LW/z9EId/2szql1ryoU/v WMPepM+9iDA7jvhnf1esuUJ8o2DSNszKbe9PdW9IXt64grUHKOvHzXmDYAuhxP3jaSH4 M6DPhelXPRKrlNKU9TJ7WJz+py/2k7lfW4OXHa5c1xAVYSlpetcJX1NbQlVDz39VcYwY VvAQ== 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; bh=EA3JTPoePl1AaECvPmFXH2b8dl/krUx9nCLDXhswaMQ=; b=tccAZAYW+68SLQKUbfr8xxhXPc5E39sfMn+Jf+/uAYPfvA3W5tGom3Nnxyx/XF3DeA U02MfDHSdC4SoIGdC+/y411mnSPlsydfZW/jSniBOgRey3Au1Luff9XGYCWn6yR6qSGC Yatg+7wfUcE3012VvSe2wfRsRfZ9LFUFQcMx6BL3gFXKfV4toiYGrgWzX9ucOGd/F8uR kFrSAl7p0bs/0kA0h9LJ3gB9pb6HR2+lUDyrxMka3nFy01TNexAo56SQPOKFowapywej 9azutrJI9Dy6e7L5Pkp8eOIiVVA4e3NkxZQCFIRmluiB8nIJgJrPJ69Amvdya2ohMBZQ AVow== 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=mtMca+Vt; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id r12si497167wru.318.2018.11.16.19.27.55; Fri, 16 Nov 2018 19:27:55 -0800 (PST) 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=mtMca+Vt; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 659A32679F4; Sat, 17 Nov 2018 04:27:53 +0100 (CET) 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 B68D02679F6; Sat, 17 Nov 2018 04:27:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE 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 BCBA32679C0 for ; Sat, 17 Nov 2018 04:27:47 +0100 (CET) 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=YmXw+5qwOFfrhZuADUXlvCfW+pUDcTW1/SiYg65hgFg=; b=mtMca+VtSBIl Q/PoEjSB9H4oY2PxJQ480a60Qcx1qxR3QNZ5JTkiZapBprdP8sEHUrXkxvHsask24RaAuPuGind1J gElyzkUGceYSKYaIQqU5flfVq7JVkXnePOa0QQdajDHEoxo4xztopXSb9IkC9WbMsCEI7rPnIcLY4 8fx5w=; Received: from [204.239.253.216] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gNrGs-0008Ly-0e; Sat, 17 Nov 2018 03:27:46 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 1D7A4440078; Sat, 17 Nov 2018 03:27:39 +0000 (GMT) From: Mark Brown To: Cheng-Yi Chiang In-Reply-To: <20181116092856.47815-1-cychiang@chromium.org> Message-Id: <20181117032739.1D7A4440078@finisterre.ee.mobilebroadband> Date: Sat, 17 Nov 2018 03:27:39 +0000 (GMT) Cc: oder_chiou@realtek.com, alsa-devel@alsa-project.org, tzungbi@chromium.org, linux-kernel@vger.kernel.org, Mark Brown , dgreid@chromium.org Subject: [alsa-devel] Applied "ASoC: rt5663: Fix error handling of regulator_set_load" 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: rt5663: Fix error handling of regulator_set_load has been applied to the asoc tree at https://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 746dca0aebd4d77adccb76c500a60028a900dabb Mon Sep 17 00:00:00 2001 From: Cheng-Yi Chiang Date: Fri, 16 Nov 2018 17:28:56 +0800 Subject: [PATCH] ASoC: rt5663: Fix error handling of regulator_set_load The default implementation of regulator_set_load returns REGULATOR_MODE_NORMAL, which is positive. [This was a bug which is being fixed but the change is valid anyway -- bronie] rt5663_i2c_probe should only do error handling when return value of regulator_set_load is negative. In this case, rt5663_i2c_probe should return error. Also, consolidate err_irq into err_enable. Fix the missing goto for temporary regmap and rt5663->regmap. Signed-off-by: Cheng-Yi Chiang Signed-off-by: Mark Brown --- sound/soc/codecs/rt5663.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) -- 2.19.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/rt5663.c b/sound/soc/codecs/rt5663.c index 29c059ed0682..da6647015708 100644 --- a/sound/soc/codecs/rt5663.c +++ b/sound/soc/codecs/rt5663.c @@ -3525,10 +3525,11 @@ static int rt5663_i2c_probe(struct i2c_client *i2c, for (i = 0; i < ARRAY_SIZE(rt5663->supplies); i++) { ret = regulator_set_load(rt5663->supplies[i].consumer, RT5663_SUPPLY_CURRENT_UA); - if (ret) { + if (ret < 0) { dev_err(&i2c->dev, - "Failed to set regulator %s, ret: %d\n", + "Failed to set regulator load on %s, ret: %d\n", rt5663->supplies[i].supply, ret); + return ret; } } @@ -3546,7 +3547,7 @@ static int rt5663_i2c_probe(struct i2c_client *i2c, ret = PTR_ERR(regmap); dev_err(&i2c->dev, "Failed to allocate temp register map: %d\n", ret); - return ret; + goto err_enable; } ret = regmap_read(regmap, RT5663_VENDOR_ID_2, &val); @@ -3579,7 +3580,7 @@ static int rt5663_i2c_probe(struct i2c_client *i2c, ret = PTR_ERR(rt5663->regmap); dev_err(&i2c->dev, "Failed to allocate register map: %d\n", ret); - return ret; + goto err_enable; } /* reset and calibrate */ @@ -3689,17 +3690,19 @@ static int rt5663_i2c_probe(struct i2c_client *i2c, rt5663_dai, ARRAY_SIZE(rt5663_dai)); if (ret) - goto err_irq; + goto err_enable; return 0; -err_irq: + + /* + * Error after enabling regulators should goto err_enable + * to disable regulators. + */ +err_enable: if (i2c->irq) free_irq(i2c->irq, rt5663); -err_enable: - dev_err(&i2c->dev, - "%s: Disable regulator after probe error\n", __func__); regulator_bulk_disable(ARRAY_SIZE(rt5663->supplies), rt5663->supplies); return ret; }