From patchwork Sun Jul 16 21:11:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9843705 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 2C39260212 for ; Sun, 16 Jul 2017 21:13:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EFF228408 for ; Sun, 16 Jul 2017 21:13:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2417828414; Sun, 16 Jul 2017 21:13:06 +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 6FA1A28408 for ; Sun, 16 Jul 2017 21:13:05 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 742A7266DA5; Sun, 16 Jul 2017 23:11:57 +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 CBA39266DED; Sun, 16 Jul 2017 23:11:54 +0200 (CEST) Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by alsa0.perex.cz (Postfix) with ESMTP id 5D8FB266A74 for ; Sun, 16 Jul 2017 23:11:40 +0200 (CEST) Received: by mail-qk0-f194.google.com with SMTP id q66so18630665qki.1 for ; Sun, 16 Jul 2017 14:11:40 -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=8wJOO7LfywgTKmygftUgSMY/1CVU2UJ9P2yq44Nx+94=; b=HhXOtR4OkoqHYPSJVZpWmIiPlixoxYB9bRDWMHQSk18jpgFCT9vEa/INgWF17iYy2P IdBTa6UBu1CQCl+vqBBcW68MOqGr5rKrkfVtsEcOjH0DSzAaX3/K6cgNVWpLilhpBhYv DNAUKq7CDfslIb1Kos3CKwbPqnOsWQivabknRcz3i/Qtwvvz1kXDyF/jMqkawyUQc8kL dO/chusFFY6/wDWC+Yd4YPBsBEWEmx0QbVAQ2J0SgajypptqdKtNHKASXbi5Lsh33tAV f9GGld1QrQMK2/I2X7Mk6D3MsYER4c4vsbtACO+nLXYaNeKQTjiTXabPLy8/etnrs5gj 53sA== 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=8wJOO7LfywgTKmygftUgSMY/1CVU2UJ9P2yq44Nx+94=; b=FwnMOqd7bRnCiXPWxto6qj/XkIo4Zd8XIN9ZfOgb5pMugGAKoTu+R+MrTjUevIj0n6 CGlwOwL2/M66UwprEkoxTE+2fxYk4Di/JbR7ktGU8lwWm29eLEJFY3aO25qsSP0WoUif IPJNWIjQHa12frZ6nSXcEocHUwi5nGnQYe/FJMhKul4CWaHZhJZlS1lFeJusNGhnmYYK gV35bVUuMreyKyiNL666SvJNyN8QBtijU964LavJdY/dumBrfHW6VI3oCOX3ei71WttJ xTMS28MzIaquoD771gkZuhOZS5e9J8vk568lq5uaFVxRPkSvMO3bylPzeZo4Kde6opAX Sa/Q== X-Gm-Message-State: AIVw111IbRk1l7wdu6wLb2x7SWQRlyNqaXeCQZf54ErRQ4hVP650HzfG JjweAEO/A5DUrw== X-Received: by 10.55.170.205 with SMTP id t196mr22205406qke.106.1500239500047; Sun, 16 Jul 2017 14:11:40 -0700 (PDT) Received: from localhost.localdomain ([187.180.181.24]) by smtp.gmail.com with ESMTPSA id u67sm10911626qkd.67.2017.07.16.14.11.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Jul 2017 14:11:38 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Date: Sun, 16 Jul 2017 18:11:12 -0300 Message-Id: <1500239473-14886-7-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 7/8] ASoC: cs53l30: 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/cs53l30.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/cs53l30.c b/sound/soc/codecs/cs53l30.c index 06933a5..92fbe63 100644 --- a/sound/soc/codecs/cs53l30.c +++ b/sound/soc/codecs/cs53l30.c @@ -842,8 +842,7 @@ static int cs53l30_mute_stream(struct snd_soc_dai *dai, int mute, int stream) { struct cs53l30_private *priv = snd_soc_codec_get_drvdata(dai->codec); - if (priv->mute_gpio) - gpiod_set_value_cansleep(priv->mute_gpio, mute); + gpiod_set_value_cansleep(priv->mute_gpio, mute); return 0; } @@ -960,8 +959,7 @@ static int cs53l30_i2c_probe(struct i2c_client *client, goto error; } - if (cs53l30->reset_gpio) - gpiod_set_value_cansleep(cs53l30->reset_gpio, 1); + gpiod_set_value_cansleep(cs53l30->reset_gpio, 1); i2c_set_clientdata(client, cs53l30); @@ -1056,8 +1054,7 @@ static int cs53l30_i2c_remove(struct i2c_client *client) snd_soc_unregister_codec(&client->dev); /* Hold down reset */ - if (cs53l30->reset_gpio) - gpiod_set_value_cansleep(cs53l30->reset_gpio, 0); + gpiod_set_value_cansleep(cs53l30->reset_gpio, 0); regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies), cs53l30->supplies); @@ -1073,8 +1070,7 @@ static int cs53l30_runtime_suspend(struct device *dev) regcache_cache_only(cs53l30->regmap, true); /* Hold down reset */ - if (cs53l30->reset_gpio) - gpiod_set_value_cansleep(cs53l30->reset_gpio, 0); + gpiod_set_value_cansleep(cs53l30->reset_gpio, 0); regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies), cs53l30->supplies); @@ -1094,8 +1090,7 @@ static int cs53l30_runtime_resume(struct device *dev) return ret; } - if (cs53l30->reset_gpio) - gpiod_set_value_cansleep(cs53l30->reset_gpio, 1); + gpiod_set_value_cansleep(cs53l30->reset_gpio, 1); regcache_cache_only(cs53l30->regmap, false); ret = regcache_sync(cs53l30->regmap);