From patchwork Wed Mar 15 11:31:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 9625411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E941960424 for ; Wed, 15 Mar 2017 11:32:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D222927E5A for ; Wed, 15 Mar 2017 11:32:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6CAF27F86; Wed, 15 Mar 2017 11:32:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D294427E5A for ; Wed, 15 Mar 2017 11:32:08 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4FA85266E13; Wed, 15 Mar 2017 12:32:04 +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 2C139266E41; Wed, 15 Mar 2017 12:32:03 +0100 (CET) Received: from metis.ext.4.pengutronix.de (metis.ext.4.pengutronix.de [92.198.50.35]) by alsa0.perex.cz (Postfix) with ESMTP id 39141266861 for ; Wed, 15 Mar 2017 12:31:58 +0100 (CET) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7] helo=dude.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.84_2) (envelope-from ) id 1co79q-0007Nn-BB; Wed, 15 Mar 2017 12:31:58 +0100 From: Philipp Zabel To: alsa-devel@alsa-project.org Date: Wed, 15 Mar 2017 12:31:57 +0100 Message-Id: <20170315113157.13218-1-p.zabel@pengutronix.de> X-Mailer: git-send-email 2.11.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, Liam Girdwood , Chen-Yu Tsai , Mark Brown , Philipp Zabel , Maxime Ripard Subject: [alsa-devel] [PATCH v2 14/14] ASoC: sunxi: simplify optional reset handling 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 X-Virus-Scanned: ClamAV using ClamSMTP As of commit bb475230b8e5 ("reset: make optional functions really optional"), the reset framework API calls use NULL pointers to describe optional, non-present reset controls. This allows to return errors from devm_reset_control_get_optional and to call reset_control_deassert unconditionally. Signed-off-by: Philipp Zabel Acked-by: Mark Brown Acked-by: Chen-Yu Tsai --- sound/soc/sunxi/sun4i-spdif.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index eaefd07a5ed08..cdf8a6d86010c 100644 --- a/sound/soc/sunxi/sun4i-spdif.c +++ b/sound/soc/sunxi/sun4i-spdif.c @@ -521,13 +521,12 @@ static int sun4i_spdif_probe(struct platform_device *pdev) if (quirks->has_reset) { host->rst = devm_reset_control_get_optional(&pdev->dev, NULL); - if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) { - ret = -EPROBE_DEFER; + if (IS_ERR(host->rst)) { + ret = PTR_ERR(host->rst); dev_err(&pdev->dev, "Failed to get reset: %d\n", ret); return ret; } - if (!IS_ERR(host->rst)) - reset_control_deassert(host->rst); + reset_control_deassert(host->rst); } ret = devm_snd_soc_register_component(&pdev->dev,