From patchwork Sun Jul 16 21:11:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9843699 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 E672660212 for ; Sun, 16 Jul 2017 21:12:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7CDD28408 for ; Sun, 16 Jul 2017 21:12:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCCBE28414; Sun, 16 Jul 2017 21:12:21 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, 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 3198728408 for ; Sun, 16 Jul 2017 21:12:21 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 519DD266D22; Sun, 16 Jul 2017 23:11:42 +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 9BBE1266D63; Sun, 16 Jul 2017 23:11:38 +0200 (CEST) Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by alsa0.perex.cz (Postfix) with ESMTP id 4928C266D49 for ; Sun, 16 Jul 2017 23:11:34 +0200 (CEST) Received: by mail-qk0-f193.google.com with SMTP id v17so16284517qka.3 for ; Sun, 16 Jul 2017 14:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=r/4FeU2LcjegJZxN8APHhP6u9Nypg91k5D3SX+XxusU=; b=rS1xuH4+TvInUnRQxCGtFDAyfZBIhqKYqm/o8rGI9pV/7tCnocIxU/vqXZrZaTnxD4 3wEVedsPsxZeAOxTSsZj/br50frSBZOdjosvXYxy/0jom8iPVl84+ZWnCh/+rN1ClZQy OXUPsv9JaKIYwDipaaJiJ2p5ma1se71PUFIS+tkCQVIhctBpaISbpW3tn18XMT+f6eNM hCtU6JsvZ8++z1NstZCvieDFk/7iRs5EEBTVhK54Wk3CABa0MxTes01PTnHKXyY7yho8 6ROpzHbQ9QUrGJzXjA3r2Opkx1169d25q22zCgTrCiVKfFGc1TBf1swseAO5l45fFEGW maRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=r/4FeU2LcjegJZxN8APHhP6u9Nypg91k5D3SX+XxusU=; b=lOsN79+iIVR1LuxI2CNlNBIDeBrn8u3f/CC4TM21qKdbhhw/NqqdtQHf2nJ+wunRYI JfApMkIG0TBIviYJBBBistcbU8NZRsKZ/VFnqkwb7kWJ7gvbgp1rVKW/gKABQkbHOt4F ucGXqpn1dIxad4G5j68AqxEeW/NCrJGfSSlbyV4u7G3A7tsDLfnjjiBU/BQlmsvSrfFY /2qGQaJ/peqXRcOqKr33RjqMgGpcYPZKFRL5JkwZxZ6ZhVPMVS7nsDVcIS0gmX5d6rWn ey8qOgkzZo3LgMruUwApaV6LY98EosgRQXj69eYpZRobbbIYId5P5yo5OyKaUdZ5+OQs /4UQ== X-Gm-Message-State: AIVw111MRi7Tka5T5B0ClKd9PgreqJKMNuXDKlNqkrnjV3j3FSFDyrzW 36NfH2RS/YOZPQ2x X-Received: by 10.55.48.18 with SMTP id w18mr24732120qkw.3.1500239493499; Sun, 16 Jul 2017 14:11:33 -0700 (PDT) Received: from localhost.localdomain ([187.180.181.24]) by smtp.gmail.com with ESMTPSA id u67sm10911626qkd.67.2017.07.16.14.11.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Jul 2017 14:11:33 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Date: Sun, 16 Jul 2017 18:11:09 -0300 Message-Id: <1500239473-14886-4-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500239473-14886-1-git-send-email-festevam@gmail.com> References: <1500239473-14886-1-git-send-email-festevam@gmail.com> Cc: Fabio Estevam , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 4/8] ASoC: cs35l33: Remove unneeded gpiod NULL check 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver. Signed-off-by: Fabio Estevam --- sound/soc/codecs/cs35l33.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/cs35l33.c b/sound/soc/codecs/cs35l33.c index 6df29fa..1eea912 100644 --- a/sound/soc/codecs/cs35l33.c +++ b/sound/soc/codecs/cs35l33.c @@ -869,8 +869,7 @@ static int __maybe_unused cs35l33_runtime_resume(struct device *dev) dev_dbg(dev, "%s\n", __func__); - if (cs35l33->reset_gpio) - gpiod_set_value_cansleep(cs35l33->reset_gpio, 0); + gpiod_set_value_cansleep(cs35l33->reset_gpio, 0); ret = regulator_bulk_enable(cs35l33->num_core_supplies, cs35l33->core_supplies); @@ -881,8 +880,7 @@ static int __maybe_unused cs35l33_runtime_resume(struct device *dev) regcache_cache_only(cs35l33->regmap, false); - if (cs35l33->reset_gpio) - gpiod_set_value_cansleep(cs35l33->reset_gpio, 1); + gpiod_set_value_cansleep(cs35l33->reset_gpio, 1); msleep(CS35L33_BOOT_DELAY); @@ -1191,8 +1189,7 @@ static int cs35l33_i2c_probe(struct i2c_client *i2c_client, return ret; } - if (cs35l33->reset_gpio) - gpiod_set_value_cansleep(cs35l33->reset_gpio, 1); + gpiod_set_value_cansleep(cs35l33->reset_gpio, 1); msleep(CS35L33_BOOT_DELAY); regcache_cache_only(cs35l33->regmap, false); @@ -1262,8 +1259,7 @@ static int cs35l33_i2c_remove(struct i2c_client *client) snd_soc_unregister_codec(&client->dev); - if (cs35l33->reset_gpio) - gpiod_set_value_cansleep(cs35l33->reset_gpio, 0); + gpiod_set_value_cansleep(cs35l33->reset_gpio, 0); pm_runtime_disable(&client->dev); regulator_bulk_disable(cs35l33->num_core_supplies,