From patchwork Wed Jul 22 01:59:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 6839051 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 43411C05AC for ; Wed, 22 Jul 2015 02:00:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 68991206E5 for ; Wed, 22 Jul 2015 02:00:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 2E43A206D0 for ; Wed, 22 Jul 2015 02:00:13 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4C25826513F; Wed, 22 Jul 2015 04:00:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 98749260600; Wed, 22 Jul 2015 04:00:03 +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 004A1260609; Wed, 22 Jul 2015 04:00:01 +0200 (CEST) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by alsa0.perex.cz (Postfix) with ESMTP id A9B602605FF for ; Wed, 22 Jul 2015 03:59:54 +0200 (CEST) Received: by pacan13 with SMTP id an13so130948494pac.1 for ; Tue, 21 Jul 2015 18:59:53 -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:content-type :mime-version:content-transfer-encoding; bh=sBBSJhsYLhM/p1zLdlqSzXf/IZU3TcEvLMu7oe9+ya0=; b=fhB96XFv/iRPpjo9S6YblPYz8zKXaPtTgQZBFfFfTQmyVwLQ4WtKIvTmfzbwuzTsA0 gYeEucpH/XBQASn5uq0Tc06rnRk/+b2zb+0J0fbIkR/FOn6k+zStdOnuCqOVrHdgws4h BkxZQPNIYxHThU2hLeQr2pITr/30aWNcBtkj02ICYdaQvaPJgJKE6GFfHut7nVYWOXpf hE2uWEQ4oynlv0mf4XiSdVPw72CCBD1s91Tl2NYpyjjl6o83TcGPn5IzmTS8f0gfYwFr QWSiQclHxp9FieFjjMU/gk5IS/JGEpEsEuXtsEFwh4CVMBxWSIX1zTrHd7yefknjrzF+ uMNg== X-Gm-Message-State: ALoCoQmVhF1gLWex5QWSxx8fDXf+BHdMGdzQ6AmumAKNQZf2fEnPeYACC2VObbtXRP+wyMBJ6jyP X-Received: by 10.70.1.102 with SMTP id 6mr117470pdl.32.1437530393069; Tue, 21 Jul 2015 18:59:53 -0700 (PDT) Received: from phoenix (1-169-147-33.dynamic.hinet.net. [1.169.147.33]) by smtp.gmail.com with ESMTPSA id g10sm29997640pat.35.2015.07.21.18.59.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2015 18:59:51 -0700 (PDT) Message-ID: <1437530387.24723.1.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Wed, 22 Jul 2015 09:59:47 +0800 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Cc: Brian Austin , alsa-devel@alsa-project.org, Liam Girdwood , Paul Handrigan , Tim Howe Subject: [alsa-devel] [PATCH] ASoC: cs4349: Remove unneeded NULL test for cs4349->reset_gpio 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 It's safe to call gpiod_set_value_cansleep() with NULL desc. Signed-off-by: Axel Lin Acked-by: Tim Howe --- sound/soc/codecs/cs4349.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/cs4349.c b/sound/soc/codecs/cs4349.c index a7538ae..852be85 100644 --- a/sound/soc/codecs/cs4349.c +++ b/sound/soc/codecs/cs4349.c @@ -300,8 +300,7 @@ static int cs4349_i2c_probe(struct i2c_client *client, if (IS_ERR(cs4349->reset_gpio)) return PTR_ERR(cs4349->reset_gpio); - if (cs4349->reset_gpio) - gpiod_set_value_cansleep(cs4349->reset_gpio, 1); + gpiod_set_value_cansleep(cs4349->reset_gpio, 1); i2c_set_clientdata(client, cs4349); @@ -316,8 +315,7 @@ static int cs4349_i2c_remove(struct i2c_client *client) snd_soc_unregister_codec(&client->dev); /* Hold down reset */ - if (cs4349->reset_gpio) - gpiod_set_value_cansleep(cs4349->reset_gpio, 0); + gpiod_set_value_cansleep(cs4349->reset_gpio, 0); return 0; } @@ -335,8 +333,7 @@ static int cs4349_runtime_suspend(struct device *dev) regcache_cache_only(cs4349->regmap, true); /* Hold down reset */ - if (cs4349->reset_gpio) - gpiod_set_value_cansleep(cs4349->reset_gpio, 0); + gpiod_set_value_cansleep(cs4349->reset_gpio, 0); return 0; } @@ -350,8 +347,7 @@ static int cs4349_runtime_resume(struct device *dev) if (ret < 0) return ret; - if (cs4349->reset_gpio) - gpiod_set_value_cansleep(cs4349->reset_gpio, 1); + gpiod_set_value_cansleep(cs4349->reset_gpio, 1); regcache_cache_only(cs4349->regmap, false); regcache_sync(cs4349->regmap);