From patchwork Sat Jul 25 07:32:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 6864581 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 A80AEC05AC for ; Sat, 25 Jul 2015 07:32:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE86F20748 for ; Sat, 25 Jul 2015 07:32:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 981302071B for ; Sat, 25 Jul 2015 07:32:45 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 65F232606D9; Sat, 25 Jul 2015 09:32:39 +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,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 50B8C2606AC; Sat, 25 Jul 2015 09:32:31 +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 F30FF2606B0; Sat, 25 Jul 2015 09:32:29 +0200 (CEST) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by alsa0.perex.cz (Postfix) with ESMTP id C81FB26069D for ; Sat, 25 Jul 2015 09:32:22 +0200 (CEST) Received: by pdbbh15 with SMTP id bh15so24422156pdb.1 for ; Sat, 25 Jul 2015 00:32:21 -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=3s77ehy6lLh0v/vFk9Uqxlp2aC4GToL9wMcRUXS0240=; b=IMmcYDru9YGcm4jQTN6/48+QIPlFknk8r6nueKXic48rKtIFZO2uB6dvfa6iragZoU v/FRsug/3dYQz+ctNXLnyCz7SfPPZcy6boh4nPDdXfi7k+681aw0gUhQ3dJUnzPfsVH3 xs5V6+5Ncl/Uv5GV+pIMSarQrmWddAZEe0VMlE74RPFTzzYppDRCSc7AsNy0CDQzyVf3 6eGp3fIvIKof5+ATvT79O9y4PM/9vUzPV0p8DDXdVG9vaz4Z6OVFRRjC/nMBHURLwt7x PNn3+Mb3+vKI+L7tOe7AWtbqy0QGf5iYOFF2dFG+b58mf/MjBzdJTki755t+TwtjGYkq r+/w== X-Gm-Message-State: ALoCoQkegwUSYkOzoxHnvFJNx+qyUf8SMIPsgB8O2V5CrAY0i4BHr6s+mEKDloh1SiWRY2/KUecf X-Received: by 10.70.135.67 with SMTP id pq3mr40836974pdb.8.1437809541103; Sat, 25 Jul 2015 00:32:21 -0700 (PDT) Received: from phoenix.local (36-239-216-55.dynamic-ip.hinet.net. [36.239.216.55]) by smtp.gmail.com with ESMTPSA id jw13sm15896606pad.48.2015.07.25.00.32.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Jul 2015 00:32:20 -0700 (PDT) Message-ID: <1437809536.5851.1.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Sat, 25 Jul 2015 15:32:16 +0800 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Cc: alsa-devel@alsa-project.org, Dan Muprhy , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: tas2552: Remove unneeded NULL test for tas2552->enable_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() with NULL desc. Signed-off-by: Axel Lin Acked-by: Dan Murphy --- sound/soc/codecs/tas2552.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index 2f6a65a..e3a0bca 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c @@ -493,8 +493,7 @@ static int tas2552_runtime_suspend(struct device *dev) regcache_cache_only(tas2552->regmap, true); regcache_mark_dirty(tas2552->regmap); - if (tas2552->enable_gpio) - gpiod_set_value(tas2552->enable_gpio, 0); + gpiod_set_value(tas2552->enable_gpio, 0); return 0; } @@ -503,8 +502,7 @@ static int tas2552_runtime_resume(struct device *dev) { struct tas2552_data *tas2552 = dev_get_drvdata(dev); - if (tas2552->enable_gpio) - gpiod_set_value(tas2552->enable_gpio, 1); + gpiod_set_value(tas2552->enable_gpio, 1); tas2552_sw_shutdown(tas2552, 0); @@ -585,8 +583,7 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec) return ret; } - if (tas2552->enable_gpio) - gpiod_set_value(tas2552->enable_gpio, 1); + gpiod_set_value(tas2552->enable_gpio, 1); ret = pm_runtime_get_sync(codec->dev); if (ret < 0) { @@ -610,8 +607,7 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec) return 0; probe_fail: - if (tas2552->enable_gpio) - gpiod_set_value(tas2552->enable_gpio, 0); + gpiod_set_value(tas2552->enable_gpio, 0); regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies), tas2552->supplies); @@ -624,8 +620,7 @@ static int tas2552_codec_remove(struct snd_soc_codec *codec) pm_runtime_put(codec->dev); - if (tas2552->enable_gpio) - gpiod_set_value(tas2552->enable_gpio, 0); + gpiod_set_value(tas2552->enable_gpio, 0); return 0; };