Received: by 10.192.165.148 with SMTP id m20csp464660imm; Fri, 27 Apr 2018 01:58:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoH7LUJ5E/G2ltQS7dTet5Fc0Iir4zqTDE3pj2gNyyygOxDnvFqp84FSY45DqvQOn+V0ash X-Received: by 2002:a63:7e49:: with SMTP id o9-v6mr1415384pgn.168.1524819481556; Fri, 27 Apr 2018 01:58:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524819481; cv=none; d=google.com; s=arc-20160816; b=q2pucpvLOG4mp/EjzHlBXSu/Th3FMguO4o77NYcC4bb/rzeqYY0r5KU4fwaIb4Ykoc itLgcG5DbxOP0KFes2vBK9V8E+w9yCqePrbewu9s7wjdJealTqUytbKFkxwdo8l4E+YQ I07vKcFO1DBeGcqqhip9jHf2FHjHCl2sweG24vOpoeKlzaBIVaoOw1Z469lnIzau9CRF xccpURvr9oESrhfvSr7NPEbqvxKfhVZD0OXJRuq01j+coYJYKglnFYwDrYC4mJuoH9f7 pWEFPWuE4sJo++N161lZwwMa/QDDMjIyS3boFBfYZSdkaICwFHyaEl68FeFz3YbxShkl Z9Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=dHsNKOFLPl+ywSEfgqc5eQ0fAJ64I5GL5ffAQ413ORs=; b=EAfcn/kdGhkB/iZjzvZRg8MHtq+WtE9Mck1+vMqgcSuez6ZAT+N+od2SyPefXKUnLr KQ5Ep51ilQiPEBvcEzbHxy/sm1YYhz6wWoHf8Uh+kJZm/APc0KbJCyz02mjbpQQge+F1 JeEZ2Cu8IMVdEplWYNnR+xzOBNCrrLFZSBYZvyEYYLAndJoKfl+lx1d3rVMmmOytZtJt b1WzAevbUxzYA3YRz6nwmEDoRUstOrX2jIPM4GVb88ibzeCl3l5GiCEEV5RMdrezCi7r cA04rdq1MWFhkYC+3hC4REptUksWQgOJM+HV6tAd0XWAO6/aqvNHkC2hCUExvpaw2dc/ lZEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hcCOEXV+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14-v6si891188plj.341.2018.04.27.01.57.47; Fri, 27 Apr 2018 01:58:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hcCOEXV+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932447AbeD0I4e (ORCPT + 99 others); Fri, 27 Apr 2018 04:56:34 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33780 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932282AbeD0I43 (ORCPT ); Fri, 27 Apr 2018 04:56:29 -0400 Received: by mail-pg0-f65.google.com with SMTP id i194-v6so1074150pgd.0; Fri, 27 Apr 2018 01:56:29 -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 :in-reply-to:references; bh=dHsNKOFLPl+ywSEfgqc5eQ0fAJ64I5GL5ffAQ413ORs=; b=hcCOEXV+XPExu+aK41Av2mUA8h6xHQsjmrh1qgQC8sA012zEkqzpOlgq2eqruyEW+u ZG9clze6cfsnQUfHGjjieoMU6lZiKeuX04l7hAzqVo23K3bQR1h1fnTtLvLWg3GSPQ0Z pPmEj3Z16yVNyP+4LO312gQ63PKvjB96Qtq9jlNiCdvnOsAJiZLkCZron61lfnnsLJuy jB/pYB+Q3YImijbseA83StHsbmFI9tAGPbqMs1YG9Kk3pzxfrfL2QDco9kVjA3fZYAKF /da9IYHISjmZQ32fzrcysVB02lPo2+PeYfc9froLnhjJidy9gRR9RboOMSd0HCnX0iz/ 5SrQ== 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:in-reply-to:references; bh=dHsNKOFLPl+ywSEfgqc5eQ0fAJ64I5GL5ffAQ413ORs=; b=Ad8FOgXdrTijf+DZ8z1U1Imikvq88nlQyT+O/d3AuSLSDVDR3ThT3Dpf30S+TjvQdH Tl18xJXPr1rMwpc/zJ0PRQ0nkYtxhZcBvqFDh4fCVPkel0YON3XE84pXPfnVYoM2+lfT ut94I+Hnz285GUVgm0jiodNBKQBFVs/Br4Lgjd3821fRXGIDN/eWISTK8kGwU8t1sWaf mqd0mwEw8kWJE/73m991mO6j/lADk7rWgtWV+Hq5/s/TosGWPWGKS3tJIpjUnzM6u3WI adHflXfBQfxTvLN2K7lWtIZTLP11St4acEJMr8kKYeQx15vEUI6/fCNxHGNFm/qUf7uV THNA== X-Gm-Message-State: ALQs6tAFRxemqqR4a7M3/uxe5ZIGTP1NmShJuuzDc4EUmopnZmoDGyvd QU9IeuCM2jE0fVItI8EAHLg= X-Received: by 10.98.72.209 with SMTP id q78mr1455742pfi.70.1524819389091; Fri, 27 Apr 2018 01:56:29 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([149.23.17.254]) by smtp.googlemail.com with ESMTPSA id q76sm2310583pfi.139.2018.04.27.01.56.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Apr 2018 01:56:28 -0700 (PDT) From: Arvind Yadav To: jikos@kernel.org, benjamin.tissoires@redhat.com, jkosina@suse.cz Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 1/3] ASoC: tlv320dac33: Use gpio_is_valid() Date: Fri, 27 Apr 2018 14:26:09 +0530 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the manual validity checks for the GPIO with the gpio_is_valid(). Signed-off-by: Arvind Yadav --- sound/soc/codecs/tlv320dac33.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index a957eae..c23b9db 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c @@ -397,13 +397,13 @@ static int dac33_hard_power(struct snd_soc_component *component, int power) goto exit; } - if (dac33->power_gpio >= 0) + if (gpio_is_valid(dac33->power_gpio)) gpio_set_value(dac33->power_gpio, 1); dac33->chip_power = 1; } else { dac33_soft_power(component, 0); - if (dac33->power_gpio >= 0) + if (gpio_is_valid(dac33->power_gpio)) gpio_set_value(dac33->power_gpio, 0); ret = regulator_bulk_disable(ARRAY_SIZE(dac33->supplies), @@ -1519,7 +1519,7 @@ static int dac33_i2c_probe(struct i2c_client *client, dac33->fifo_mode = DAC33_FIFO_BYPASS; /* Check if the reset GPIO number is valid and request it */ - if (dac33->power_gpio >= 0) { + if (gpio_is_valid(dac33->power_gpio)) { ret = gpio_request(dac33->power_gpio, "tlv320dac33 reset"); if (ret < 0) { dev_err(&client->dev, @@ -1548,7 +1548,7 @@ static int dac33_i2c_probe(struct i2c_client *client, return ret; err_get: - if (dac33->power_gpio >= 0) + if (gpio_is_valid(dac33->power_gpio)) gpio_free(dac33->power_gpio); err_gpio: return ret; @@ -1561,7 +1561,7 @@ static int dac33_i2c_remove(struct i2c_client *client) if (unlikely(dac33->chip_power)) dac33_hard_power(dac33->component, 0); - if (dac33->power_gpio >= 0) + if (gpio_is_valid(dac33->power_gpio)) gpio_free(dac33->power_gpio); return 0; -- 1.9.1