From patchwork Sun Jul 16 21:11:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9843703 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 AA31A60212 for ; Sun, 16 Jul 2017 21:12:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC00028408 for ; Sun, 16 Jul 2017 21:12:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A11A028414; Sun, 16 Jul 2017 21:12:50 +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 CB68128408 for ; Sun, 16 Jul 2017 21:12:49 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 859CE266D8D; Sun, 16 Jul 2017 23:11:43 +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 BE145266D63; Sun, 16 Jul 2017 23:11:40 +0200 (CEST) Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) by alsa0.perex.cz (Postfix) with ESMTP id 87CAD266D69 for ; Sun, 16 Jul 2017 23:11:38 +0200 (CEST) Received: by mail-qk0-f196.google.com with SMTP id q66so18630618qki.1 for ; Sun, 16 Jul 2017 14:11:38 -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=juAgbsovxLxrUv2ImieecJEl+73bJP11Fw/SmHiotDo=; b=q0K1UaxTrwfU3ruk6TuXiukFv+d8e70rQkTE+D5PkTQbzGBPEN5nDGA/sre70kTXc7 AfKxYCH23pqP2tC6VejQaP+2qV5ZK4MdF2EJGhQUHpn8tB4zIZTBytDMWd/EFrt5nsJp x4KfVKFyB6eggCby7R02T12D1RnSWOyAQvSUv17KJ8KCy4Df/qJugUQjlqfVydg7nZeh 4mf+Aheyd6tEwDW1E0CGxASx2N6dJ9XTN5CbNFlOJxdVW9WbyWMjOXUz7rAlKWAFszHp DtBxxuRfkfqAwhByBnBFwlhrFhc2j6bUTGVfNsS1ys/4Y4RnylulYXq9U/TONbtWLGEy UC0g== 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=juAgbsovxLxrUv2ImieecJEl+73bJP11Fw/SmHiotDo=; b=olNcaExWwE2YpOY7zELJmL9Pc6Li8yMaBY25vwZSQFvkXCunfINhsP2m9S4dlVfnuV 270GJ2r17Pm+BZYKEl1PLCBDcj6HMVUU8U7fJrpHfGQIenrGZGISWI3DcKi4OeDjIOkz MxZmcIQTJ5zI95QX6bNh3dUzqCDAaTvaq21ktXzigvMJ3ZJHzIOQlw1GObV7neIs0ZFJ KdokT3ckii61GRpVrtx8T7xxCrTeJwr+4GKGRmAN5+xs4yyUfuOpK5S7EfdykhC+Hd0f qBIetB2nKwoRJA0qQafF4HPDCInocQUobF/HSgbGbYYMVwETgYhzd0KEtC7xXpJAORTY cnBw== X-Gm-Message-State: AIVw1113upcULKbUS3yLQkjdbWe+xVlPtpFY0QE6io+oCInymRev4389 XhMWeGRbK4kkRw== X-Received: by 10.55.192.10 with SMTP id o10mr24009356qki.86.1500239497496; Sun, 16 Jul 2017 14:11:37 -0700 (PDT) Received: from localhost.localdomain ([187.180.181.24]) by smtp.gmail.com with ESMTPSA id u67sm10911626qkd.67.2017.07.16.14.11.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 16 Jul 2017 14:11:37 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Date: Sun, 16 Jul 2017 18:11:11 -0300 Message-Id: <1500239473-14886-6-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 6/8] ASoC: cs42l42: 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/cs42l42.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 55e4520..55caf5f 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -1898,8 +1898,7 @@ static int cs42l42_i2c_remove(struct i2c_client *i2c_client) snd_soc_unregister_codec(&i2c_client->dev); /* Hold down reset */ - if (cs42l42->reset_gpio) - gpiod_set_value_cansleep(cs42l42->reset_gpio, 0); + gpiod_set_value_cansleep(cs42l42->reset_gpio, 0); return 0; } @@ -1913,8 +1912,7 @@ static int cs42l42_runtime_suspend(struct device *dev) regcache_mark_dirty(cs42l42->regmap); /* Hold down reset */ - if (cs42l42->reset_gpio) - gpiod_set_value_cansleep(cs42l42->reset_gpio, 0); + gpiod_set_value_cansleep(cs42l42->reset_gpio, 0); /* remove power */ regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies), @@ -1937,8 +1935,7 @@ static int cs42l42_runtime_resume(struct device *dev) return ret; } - if (cs42l42->reset_gpio) - gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); + gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); regcache_cache_only(cs42l42->regmap, false); regcache_sync(cs42l42->regmap);