From patchwork Thu Jul 23 00:29:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 6848661 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 72D249F358 for ; Thu, 23 Jul 2015 00:30:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93844206E8 for ; Thu, 23 Jul 2015 00:30:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5337D206D5 for ; Thu, 23 Jul 2015 00:30:21 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4D8B3265721; Thu, 23 Jul 2015 02:30:20 +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 9EC9326572D; Thu, 23 Jul 2015 02:30:10 +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 C9FD226572D; Thu, 23 Jul 2015 02:30:09 +0200 (CEST) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by alsa0.perex.cz (Postfix) with ESMTP id 9E37026559B for ; Thu, 23 Jul 2015 02:30:02 +0200 (CEST) Received: by pachj5 with SMTP id hj5so146794138pac.3 for ; Wed, 22 Jul 2015 17:30:01 -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=Dx5PF+J1odMlalZfWLIyA93YrcqTPhqNBJ0uYqWcDFY=; b=YdS4C3MAkAFdH3ByVpcsxoADbcPiEY5LbNEesHgmR4O0jfNo+Ws/c9ACahU3FbTIaT D+R8cUwJPjrr2rj5Wt1wNswx2+OVy2j+KkFQB8PB5E+OCMufvOi/lvEp8GBCfzZ6ZOfz Y4lvVXkHsg7oFW+CF9fxve+Jxoqn3veMPpjw0J+AT6Jjv1837Nj77pAMUzYU8rTBet5Q krdPmYmX8pzrObOPLMXZFvsJlBBEJd+IH/UOIztE2ZJS46JdUYK2AyL27PS7GlssDvSd Fkvy89FmWpUEcoNfXDxDC6uaiMkjUeP2MJ8xClwux92gUfQXTgYX+6blpQE8z76wKDQm mmKw== X-Gm-Message-State: ALoCoQmPJcykeqhhfdFLWgoRjudI8j2cN21YGJ0tbvWb/oixGBqJEIB931E4kx0ww7XnW7FO3mEv X-Received: by 10.66.136.172 with SMTP id qb12mr12073756pab.84.1437611401716; Wed, 22 Jul 2015 17:30:01 -0700 (PDT) Received: from phoenix (1-169-147-33.dynamic.hinet.net. [1.169.147.33]) by smtp.gmail.com with ESMTPSA id l1sm5360666pdp.71.2015.07.22.17.29.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 17:30:00 -0700 (PDT) Message-ID: <1437611397.6620.5.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Thu, 23 Jul 2015 08:29:57 +0800 In-Reply-To: <1437611330.6620.4.camel@ingics.com> References: <1437611330.6620.4.camel@ingics.com> 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 Subject: [alsa-devel] [PATCH 2/2] ASoC: cs35l32: Remove unneeded NULL test for cs35l32->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 --- sound/soc/codecs/cs35l32.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/cs35l32.c b/sound/soc/codecs/cs35l32.c index 7e7d243..203c720 100644 --- a/sound/soc/codecs/cs35l32.c +++ b/sound/soc/codecs/cs35l32.c @@ -441,8 +441,7 @@ static int cs35l32_i2c_probe(struct i2c_client *i2c_client, if (IS_ERR(cs35l32->reset_gpio)) return PTR_ERR(cs35l32->reset_gpio); - if (cs35l32->reset_gpio) - gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); + gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); /* initialize codec */ ret = regmap_read(cs35l32->regmap, CS35L32_DEVID_AB, ®); @@ -536,8 +535,7 @@ static int cs35l32_i2c_remove(struct i2c_client *i2c_client) snd_soc_unregister_codec(&i2c_client->dev); /* Hold down reset */ - if (cs35l32->reset_gpio) - gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); + gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); return 0; } @@ -551,8 +549,7 @@ static int cs35l32_runtime_suspend(struct device *dev) regcache_mark_dirty(cs35l32->regmap); /* Hold down reset */ - if (cs35l32->reset_gpio) - gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); + gpiod_set_value_cansleep(cs35l32->reset_gpio, 0); /* remove power */ regulator_bulk_disable(ARRAY_SIZE(cs35l32->supplies), @@ -575,8 +572,7 @@ static int cs35l32_runtime_resume(struct device *dev) return ret; } - if (cs35l32->reset_gpio) - gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); + gpiod_set_value_cansleep(cs35l32->reset_gpio, 1); regcache_cache_only(cs35l32->regmap, false); regcache_sync(cs35l32->regmap);