From patchwork Sat May 9 13:39:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 6369441 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1D9CDBEEE1 for ; Sat, 9 May 2015 13:40:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4682920340 for ; Sat, 9 May 2015 13:40:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 04C93202EC for ; Sat, 9 May 2015 13:40:19 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 17589260524; Sat, 9 May 2015 15:40:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id E786F260509; Sat, 9 May 2015 15:40:11 +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 73F4D260523; Sat, 9 May 2015 15:40:08 +0200 (CEST) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by alsa0.perex.cz (Postfix) with ESMTP id 422D7260504 for ; Sat, 9 May 2015 15:40:01 +0200 (CEST) Received: by pabsx10 with SMTP id sx10so72785040pab.3 for ; Sat, 09 May 2015 06:40:00 -0700 (PDT) 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:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=SeztLy2kGzOu4dhS9QCkef4ACMFEBr7PJuCdNS8ty50=; b=Q2siy1vzPq2H2Q00MW/y5233nJz8W8Xc4pbo5wfyKD00CgtDuSPM3VOmMmzjbhlWqg glMaKf8LC8fBTok2ja8FK+HpyAQjfl4A6BxwHujElMoyv3tqgp6r2C6O9WCYRZk88/I6 1OBBK1qdStblzac0S9hPAMujjWIl09izUZN9p0vDbcQ9mpibomnhFlX1hjuyKzgefAxu 84WUx22OXzImJgdIQZtfV1nco90JOeuNE2arEweGEa1W1fckfN4SWqc34jqS1BZ7E+r4 9qUhx5+7VL1fy+roSVt1KtY3A90NjnnUcqy2QlEQAn23GHXfiHs+Xm0ylFXmkD/rEBkF oEYA== X-Gm-Message-State: ALoCoQl8tVZ08SNOY2pCestKs2tC3EvNJMMZjd69J38CEcuPLlweyFwNWFxDce/vKcD+MO6zeHA1 X-Received: by 10.68.218.9 with SMTP id pc9mr4791827pbc.2.1431178800552; Sat, 09 May 2015 06:40:00 -0700 (PDT) Received: from phoenix.local (218-164-135-86.dynamic.hinet.net. [218.164.135.86]) by mx.google.com with ESMTPSA id pn6sm8096195pdb.72.2015.05.09.06.39.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 May 2015 06:39:59 -0700 (PDT) Message-ID: <1431178796.23049.2.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Sat, 09 May 2015 21:39:56 +0800 In-Reply-To: <1431178721.23049.0.camel@ingics.com> References: <1431178721.23049.0.camel@ingics.com> X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Cc: Johannes Stezenbach , Sven Brandau , Liam Girdwood , "alsa-devel@alsa-project.org" Subject: [alsa-devel] [PATCH 2/2] ASoC: sta350: Use devm_gpiod_get_optional appropriate place 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 is equivalent to devm_gpiod_get(), except that when no GPIO was assigned to the requested function it will return NULL. This is convenient for drivers that need to handle optional GPIOs. I just checked the code in commit 34d7c3905adb9a9 ("ASoC: improve usage of gpiod API") and found that it should use devm_gpiod_get_optional rather than devm_gpiod_get here. Signed-off-by: Axel Lin --- sound/soc/codecs/sta350.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/sta350.c b/sound/soc/codecs/sta350.c index 50d8bbf..0cea8f9 100644 --- a/sound/soc/codecs/sta350.c +++ b/sound/soc/codecs/sta350.c @@ -1217,8 +1217,8 @@ static int sta350_i2c_probe(struct i2c_client *i2c, if (IS_ERR(sta350->gpiod_nreset)) return PTR_ERR(sta350->gpiod_nreset); - sta350->gpiod_power_down = devm_gpiod_get(dev, "power-down", - GPIOD_OUT_LOW); + sta350->gpiod_power_down = devm_gpiod_get_optional(dev, "power-down", + GPIOD_OUT_LOW); if (IS_ERR(sta350->gpiod_power_down)) return PTR_ERR(sta350->gpiod_power_down);