From patchwork Thu Jun 30 00:13:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 9206381 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 D7F9260757 for ; Thu, 30 Jun 2016 00:52:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA03C28462 for ; Thu, 30 Jun 2016 00:52:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF210284B6; Thu, 30 Jun 2016 00:52:32 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no 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 7432328462 for ; Thu, 30 Jun 2016 00:52:31 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9232B2666E8; Thu, 30 Jun 2016 02:52:30 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 02061265E22; Thu, 30 Jun 2016 02:49:30 +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 18CA4265E22; Thu, 30 Jun 2016 02:49:28 +0200 (CEST) Received: from mail-pa0-f66.google.com (mail-pa0-f66.google.com [209.85.220.66]) by alsa0.perex.cz (Postfix) with ESMTP id D08A5265FAE for ; Thu, 30 Jun 2016 02:13:40 +0200 (CEST) Received: by mail-pa0-f66.google.com with SMTP id ts6so5621553pac.0 for ; Wed, 29 Jun 2016 17:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:mime-version :content-transfer-encoding; bh=8inAZAkCaf4UchzvVb4xoXHXE+HQ1OPWiMY2MceU2wg=; b=ZOZ4aQFPxrlbw8c/gDiFJ7GsLL0cBdyvo64JmCqfcr75xpUhvfaBgyTXhzUZDFiwtt +aKKNtpbsNj3j683WJWFBdrWbMDkpJo/yj6sYiwztB3jelI6V9zH6P5h7ylIiq0XzUFe L5Zm2oiaGsENS1YHrFd+OECq3gGnhxbxsX/ql9JK7IVjSYYVlIWDr8Ak2eAzI+LFcDfp /vCF1ryDlvg7LmGZg58qZgU9l+g8yPgl5eIouaoJj4v9qk0NyZJERyeaawh5w3T90Pu1 TOwNEmepBgWhks/eOXQ3x/OTKT1CMhXXIVbNeIX9B3ToXPS4Z4i+05s5vOE9b947wJqZ eepg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:mime-version :content-transfer-encoding; bh=8inAZAkCaf4UchzvVb4xoXHXE+HQ1OPWiMY2MceU2wg=; b=D4PHdb9VJXcXMXebHO+cUCUE7IQklfZE1aMw96737kvzgMhATeXZfHiwC7fPWS9jTt +VlreVroZP/LSsKRotiazH9oeNGr54S466zBkyQZhCWtY/jseZIDi16valkOrGiWlvNs 0SenzyQLYWNNbc+QqE0A9zi9EmxRMd8cUEjGKCp+DXx4++Ll6ZdNRgODF/1/XuQfk9ou qIh6aH6W0emyswa3rMKJXhXsmV3o+z61uS79jW2KvgSszYGigiOS/fwj5vbCBy138BBL +fLfgFLF3BStKLxnZAFZoMvAYTj34rNbxfuPd/0h7dXMLGsfH/poDUNgAfiKPoNrR3F2 mr2Q== X-Gm-Message-State: ALyK8tLlhYYY7NOiNHvuCT22TKKDpLQoLx4iP87LCiTGyPHIABf8q0o95nq1r4jPufirLw== X-Received: by 10.66.155.229 with SMTP id vz5mr16422998pab.148.1467245619112; Wed, 29 Jun 2016 17:13:39 -0700 (PDT) Received: from [192.168.1.168] (118-167-23-90.dynamic.hinet.net. [118.167.23.90]) by smtp.gmail.com with ESMTPSA id w27sm483546pfa.54.2016.06.29.17.13.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jun 2016 17:13:37 -0700 (PDT) Message-ID: <1467245614.7105.2.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Thu, 30 Jun 2016 08:13:34 +0800 X-Mailer: Evolution 3.16.5-1ubuntu3.1 Mime-Version: 1.0 Cc: Brian Austin , alsa-devel@alsa-project.org, Liam Girdwood , Paul Handrigan Subject: [alsa-devel] [PATCH 1/2] ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP devm_gpiod_get_optional() returns NULL when the gpio is not assigned. So the if (PTR_ERR(cs35l33->reset_gpio) == -ENOENT) test is always false. Signed-off-by: Axel Lin Acked-by: Paul Handrigan --- sound/soc/codecs/cs35l33.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sound/soc/codecs/cs35l33.c b/sound/soc/codecs/cs35l33.c index 622a111..aa5c0c5 100644 --- a/sound/soc/codecs/cs35l33.c +++ b/sound/soc/codecs/cs35l33.c @@ -1176,11 +1176,7 @@ static int cs35l33_i2c_probe(struct i2c_client *i2c_client, /* We could issue !RST or skip it based on AMP topology */ cs35l33->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev, "reset-gpios", GPIOD_OUT_HIGH); - - if (PTR_ERR(cs35l33->reset_gpio) == -ENOENT) { - dev_warn(&i2c_client->dev, - "%s WARNING: No reset gpio assigned\n", __func__); - } else if (IS_ERR(cs35l33->reset_gpio)) { + if (IS_ERR(cs35l33->reset_gpio)) { dev_err(&i2c_client->dev, "%s ERROR: Can't get reset GPIO\n", __func__); return PTR_ERR(cs35l33->reset_gpio);